我剛剛從JQ UI 1.8.23切換到1.10。至於這個版本,ajaxOptions
被棄用,現在用ui.ajaxSettings
來代替。發佈數據JQuery UI選項卡1.10
這是我的代碼怎麼看起來像:
$("#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設計有一個重要特徵 - 添加後期數據的能力 - 遺漏了! – user1055761
http://bugs.jqueryui.com/ticket/8673 – damko