[英]XML Parsing Error: no element found Location error in jQuery ajax
我正在嘗試使用jquery作為以下代碼來調用跨域Rest服務:
$.ajaxSetup({ scriptCharset: "utf-8" , contentType: "application/json; charset=utf-8"});
var newUrl = "http://127.0.0.1:1338/app?restUrl=" + encodedURL; //dynamic url
$.getJSON(newUrl, function(result){
//response data are now in the result variable
alert("inside");
alert(result);
});
但是,當我嘗試在mozilla中執行時,我在Firebug中收到此錯誤。
XML解析錯誤:找不到元素位置:moz-nullprincipal:{f8dedba7-d539-45da-a5aa-53d5ae919084}行號1,列1:
但是我在Firebug中的身份是:
GET http://localhost:1338/app?restUrl=http://localhost:9090/Bank2/service/helloRest/greet
200 OK 6ms jquery.min.js(第18行)
由於該錯誤,我無法在getJson內獲取警報。 誰能指導我?
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.