jQuery的用户界面的选项卡。传递一个查询字符串 [英] jquery-ui-tabs. passing a querystring
问题描述
如何传递查询字符串(?id = avalue)以及与以下标签相关联的以下每个链接。我试图在选项卡中打开外部内容(它工作正常),但我没有传递带有网址的参数。每个链接的参数值都相同。
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.
我的功能代码:
<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.
提前致谢
推荐答案
您可以使用 ajaxOptions
选项。 tabs小部件将这些选项传递给 jQuery.ajax()
。
You can use the ajaxOptions
option. The tabs widget will pass these options onto jQuery.ajax()
.
以下代码使用数据
选项> jQuery.ajax()函数将 getId
函数(本例中为Unix风格的时间代码)的结果传递给服务器选中一个标签。
请求网址看起来像 RequestActionUpdate.aspx?id = 1255015611701
:
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 } }
});
这篇关于jQuery的用户界面的选项卡。传递一个查询字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!