我目前正在jquery中的程序工作。我的程序在Firefox 3.5中運行良好,但是直到我將瀏覽器升級到Firefox 4.0。從那以後,'parsererror'從未失敗過,它讓我頭痛不已。
我已經通知這是我的代碼的一部分,首先「parsererror」顯示:
$(document).ready(function() {
...
$.ajaxSetup({
timeout: 10000,
error: function(xhr, msg, e) {
showMessage('HTTP error: ' + JSON.stringify(msg) + '.'); //this is the parsererror
}
});
.
.
})
不僅如此,我的動態標籤不會再出現在我的網頁。我注意到,每次如果刪除此行'<script type="text/javascript" src="js/jquery-1.4.4.min.js"></script>
',它似乎但我的其他jquery元素是不好的。我不知道什麼是錯的。也許它有一些不兼容的問題,但我不知道從哪裏開始修復。請幫忙。
編輯: 這是它返回的JSON。這應該是我的動態菜單,它將創建您單擊的選項卡Evry菜單。但是這並沒有表現出來。
[
{"title": "File","submenus":[
{"title": "Open","submenus":[]},
{ "title": "New", "submenus":[]},
{ "title": "Save as", "submenus":[]},
{ "title": "Save", "submenus":[]}
]},
{ "title": "View","submenus":[]},
{ "title": "viewAll", "submenus":[]},
{ "title": "Close","submenus":[]},
{"title":"jQgrid", "submenus":[]}
]
你能提供JSON數據的樣子嗎? – 2011-05-12 02:57:18
我的JSON來自服務器端。我只是將其轉換爲json,以便程序能夠讀取它。這裏是我的示例代碼:http://stackoverflow.com/questions/5309114/why-is-it-that-i-cannot-sort-my-grid-in-jqgrid-everytime-i-clicked-the-column-hea – jayAnn 2011-05-12 03:07:18