javascript - Unexpected token < error -
this question has answer here:
- using jsonp when returning xml 3 answers
i have problem project. idea:
- bypass cors domain jsonp: !
- converted xml jsonp: because data in domain xml.
- do data xml file.
the problem is: return: unexpected token <
. know can't read xml jsonp datatype. in opinion, js can converted xml jsonp, if it's right. please suggest me how use it.
this code:
function test(){ $.ajax({ type: 'get', datatype: "jsonp", processdata: true, crossdomain: true, jsonp: true, url: "http://huysoi.com/den.xml", //converters: {"xml": jquery.parsexml}, username: 'admin', password: 'admin', success: function (responsedata, textstatus, jqxhr) { console.log('in'); }, error: function (responsedata, textstatus, errorthrown) { alert('post failed.'); } }); <input type="button" onclick="return test();" >
it won't work. can't send ajax request xml jsonp. had same problem , used post messaging iframe solving cross domain problem
Comments
Post a Comment