在 jQuery UI AJAX 加载的选项卡上传递变量
我在使用 PHP 和 jQuery 构建的在线应用程序上遇到了一个独特的 UI 问题。该页面由 jQuery UI 选项卡组成,通过 ajax 方法加载数据。从呈现选项卡的 index.php 开始,用户可以打开 jQuery UI 对话框模式窗口来选择用户。选择用户后(通过其姓名旁边的链接),函数应关闭对话框窗口,选择选项卡索引 #1,并为已加载的页面提供一个变量,以允许我运行填充用户数据的查询在该页面中。
一切都运行良好,但最后一部分......我无法将变量传递到页面来挽救我的生命。
首先,设置:
<ul>
<li><a href="dashboard.php">Dashboard</a></li>
<li><a href="currentcall.php">Current Call</a></li>
<li><a href="managequeue.php">Manage Queue</a></li>
<li><a href="admin.php">Admin</a></li>
</ul>
<script type="text/javascript">
var curtab = $('#tabs').tabs();
function chooseSearchProspect(prospect_id, allow_open) {
$('#prospect_search_modal').dialog('close');
$("#tabs").tabs({
disabled: [],
selected: 1,
});
}
</script>
我尝试了几种不同的方法,包括通过“Ajax选项”字段传递ajax参数 如此处所述 这似乎是理想的解决方案,但无论我做什么,似乎都无法通过 currentcall.php 获取 $_REQUEST 参数。我不能仅仅通过函数中的 $('#id').val()
在 currentcall.php 中设置隐藏变量,因为选项卡将打开的页面尚未被设置尚未加载到 DOM 中。我不知道从这里该去哪里!
I've got a unique UI issue on an online application built with PHP and jQuery. The page is made of jQuery UI tabs which load data via the ajax method. Starting on the index.php where the tabs are rendered, the user is allowed to open a jQuery UI dialog modal window to select a user. Upon choosing a user (via a link next to their name) a function should close the dialog window, select tab index #1, and make a variable available to the page that's loaded to allow me to run a query that will populate the user data in that page.
All is working well but the last part....I can't get a variable to the page to save my life.
First, the setup:
<ul>
<li><a href="dashboard.php">Dashboard</a></li>
<li><a href="currentcall.php">Current Call</a></li>
<li><a href="managequeue.php">Manage Queue</a></li>
<li><a href="admin.php">Admin</a></li>
</ul>
<script type="text/javascript">
var curtab = $('#tabs').tabs();
function chooseSearchProspect(prospect_id, allow_open) {
$('#prospect_search_modal').dialog('close');
$("#tabs").tabs({
disabled: [],
selected: 1,
});
}
</script>
I've tried several different methods including passing ajax parameters via the "Ajax Options" field as described here which seems like the ideal solution, but no matter what I do it seems I can't get a $_REQUEST parameter through to currentcall.php. I can't just set a hidden variable in the currentcall.php via $('#id').val()
in the function, because the page that will be opened by tabs hasn't been loaded into the DOM yet. I'm at a loss where to go from here!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在
ajaxOption
解决方案中,您需要使用一个函数,以便每次进行 ajax 调用时都会重新评估它。
In the
ajaxOption
solution you need to use a function so that it is re-evaluated each time the ajax call is being made..use