尝试加载 xml 文件并获取 xml 解析错误。
$("#analyticForm_description").load('https://192.168.23.10/SystemServices/main?system:run=html/indicators/templates/editApp-definition.xml&Id=1000205&palletId=testtt', function() { MD.ui.editPallets.editform_definition(); } );
不应该抛出任何错误。请注意,提供的 url 有效并可直接从浏览器访问。该函数也被调用。不知何故,即使在控制台上报告错误后,页面加载成功。
不想看到控制台上报告的任何错误。
我认为 Firefox 需要一个 Content-Type 而 Chrome 忽略它。
$.ajax({
url : "https://192.168.23.10/SystemServices/main?system:run=html/indicators/templates/editApp-definition.xml&Id=1000205&palletId=testtt",
contentType: "text/xml",
success : function(response) {
$("#analyticForm_description").html(response);
}
});
或者对于 load 方法使用ajaxSetup:
描述:为未来的 Ajax 请求设置默认值。不推荐使用它。
$.ajaxSetup({
contentType: "text/xml"
});
$("#analyticForm_description").load('https://192.168.23.10/SystemServices/...', function() {
MD.ui.editPallets.editform_definition();
});
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句