这个 xml 正确吗
这个xml有问题吗?
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<results xmlns="http://www.host.com/type">
<result>
<attr value="" name="TitleBlock1"/>
<attr value="" name="TitleBlock2"/>
<attr value="Introductory" name="rev"/>
</result>
</results>
当我从服务器收到响应时..当我签入 firebug 时,它说因为
XML Parsing Error: no element found Location: moz-nullprincipal:{3c06a977-b497-5c43f72584c8} Line Number 1, Column 1:
^
我没有从服务器收到任何响应,而且我还收到对此 url https 的 200 Ok 请求://rest-search.host.com/machine/search/meta?id=TR
但没有回复。这是下面的代码
var search_agile_metadata= 'https://rest-search.host.com/m/search/meta?id=';
var on_show_info_agile = function() {
request_meta_info = $.ajax({
url: data + current_doc_info.id,
type: 'GET',
success: data,
error: data
});
};
所以想更改 url 以获取 json 响应。当我将 dataType 更改为 script 时,我收到了响应,但出现错误 missing ;之前的声明
。我不知道我做错了什么
Is there any problem with this xml??
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<results xmlns="http://www.host.com/type">
<result>
<attr value="" name="TitleBlock1"/>
<attr value="" name="TitleBlock2"/>
<attr value="Introductory" name="rev"/>
</result>
</results>
As when I am getting response back from the server.. and when I checked in firebug, it is saying that
XML Parsing Error: no element found Location: moz-nullprincipal:{3c06a977-b497-5c43f72584c8} Line Number 1, Column 1:
^
As I am not getting any response back from the server, and also I am getting 200 Ok request for this url https://rest-search.host.com/machine/search/meta?id=TR
but no response back. This is below code
var search_agile_metadata= 'https://rest-search.host.com/m/search/meta?id=';
var on_show_info_agile = function() {
request_meta_info = $.ajax({
url: data + current_doc_info.id,
type: 'GET',
success: data,
error: data
});
};
So thought to change the url to get the json response. And when I change the dataType to script then I get the response back but with the error missing ; before statement
. I don't know what I am doing wrong
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
服务器响应是否缺少 Access-Control-Allow-Origin 标头,这将允许您的 javascript 读取响应?
Is the server response missing the Access-Control-Allow-Origin header which will allow your javascript to read the response?