JQuery UI tabs. passing request

How to pass a query string (? Id = avalue) with each of the following tabbed links below. I am trying to open external content in tabs (so that it works fine), but I could not pass the parameter with the urls. The value for the parameter will 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 greatly appreciated.

Thank you in advance

+5
source share
4 answers

You can use the option ajaxOptions. The tab widget will pass these parameters on jQuery.ajax().

data jQuery.ajax() getId ( Unix ) .
URL- : RequestActionUpdate.aspx?id=1255015611701:

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

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

:

<li><a href="RequestActionUpdate.aspx?id=avalue"><span>Update</span></a></li>

. ? - ?

+1

, , - , :

window.location = href + '?id=avalue'

hrefs . /, , ;

$(document).ready(function(){
    value = "?id=foobar"
    $("#tabs ul li a").attr('href', ($(this).attr('href') + value) );
});

, .

+1

, ?

$("#tabs ul li a").click(
    function(){
       $(this).attr('href', $(this).attr('href') + $('#someHiddenInput').val());
     }
);
+1

All Articles