jQuery的用户界面的选项卡。传递一个查询字符串

编程入门 行业动态 更新时间:2024-10-28 02:21:29
本文介绍了jQuery的用户界面的选项卡。传递一个查询字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

如何传递查询字符串(?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的用户界面的选项卡。传递一个查询字符串

本文发布于:2023-06-09 06:30:44,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/596877.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:字符串   用户界面   选项卡   jQuery

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!