javascript - Unexpected token < error -


this question has answer here:

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();" > 

enter image description here

it won't work. can't send ajax request xml jsonp. had same problem , used post messaging iframe solving cross domain problem

see https://github.com/ofirdagan/cross-domain-local-storage


Comments

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - .htaccess mod_rewrite for dynamic url which has domain names -

Website Login Issue developed in magento -