jquery-ui-tabs. passing a querystring

jquery, query-string, user-interface

Solution

You can use the `ajaxOptions` option. The tabs widget will pass these options onto `jQuery.ajax()`.

The following code uses the `data` option of the `jQuery.ajax()` function to pass the result of the `getId` function (a Unix-style time code in this example) to the server when a tab is selected. The request url will look something like `RequestActionUpdate.aspx?id=1255015611701`:

function getId() {
  return (new Date()).getTime();
}

$("#tabs").tabs({
  spinner:'<b>Retrieving Data...</b>',
  ajaxOptions: { data: { id: getId } }
});

Problem

How could I pass a query string (?id=avalue) with each of the below links associated to the below tabs. I am attempting to open external content within the tabs (that it's working fine) but I have failed to pass a parameter with the urls. The value for the parameter would be the same for each link. My functioning code: ``` <script type="text/javascript"> $(function() { $("#tabs").tabs({spinner:'<b>Retrieving Data...</b>'}); }); </script> <div id="tabs"> <ul> <li><a href="table.aspx"><span>Introduction</span></a></li> <li><a href="RequestActionUpdate.aspx"><span>Update</span></a></li> <li><a href="tabstesttarget.aspx"><span>Target</span></a></li> <li><a href="table.aspx" ><span>View History</span></a></li> </ul> </div> ``` Any help you can offer me will be much appreciated. Thanks in advance

Original source