【发布时间】:2013-01-23 13:24:09
【问题描述】:
我刚刚从 JQ UI 1.8.23 切换到 1.10。 至于这个版本,ajaxOptions 已弃用,现在使用 ui.ajaxSettings 代替。
这就是我的代码的样子:
$( "#tabs" ).tabs({
ajaxOptions: {
type : 'POST',
data : 'format=html',
error: function( xhr, status, index, anchor ) {
$( anchor.hash ).html(
"Couldn't load this tab. We'll try to fix this as soon as possible. " +
"If this wouldn't be a demo. " );
},
success: function() {
*Something in here*
}
}
});
一切正常。现在新代码:
$( "#tabs" ).tabs({
beforeLoad: function( event, ui ) {
ui.ajaxSettings.type = 'POST';
ui.ajaxSettings.data = 'format=html';
ui.jqXHR.error(function() {
ui.panel.html(
"Couldn't load this tab. We'll try to fix this as soon as possible. " +
"If this wouldn't be a demo." );
});
ui.jqXHR.success(function(){
*something in here*
});
}
});
所以我需要将此数据format=html 发布到我的服务器,但是使用新版本,我发送到服务器的发布变量是空的。没有任何东西发送到服务器。另外,如果我想在php script 中获取 POST 变量,则数组为空。我正在使用ZEND 顺便说一句。我需要通过 POST 发送它 - 没有办法解决它。
感谢您的帮助
【问题讨论】:
-
你解决了吗?我已经搜索过,似乎没有解决方案。看起来 UI-Tabs 设计有一个重要功能 - 添加后期数据的能力 - 被忽略了!
标签: jquery jquery-ui zend-framework post