jquery - CORS AJAX domain rest request -


i have url returns xml data , uses url username , password.

$.ajax({     url: 'http://myserver.com:port/bc/rest/productslist/',     data: {         'username': 'username',          'password': 'password'     },     datatype: "jsonp", // cross domain     contenttype: "application/xml; charset=utf-8",     type: 'get',     crossdomain: true,     beforesend : function(xhr) {         xhr.setrequestheader("authorization", "basic" + window.btoa("username" + ":"+ "password"));     },         success: function(sucessresponse) {          alert('put completed' + sucessresponse);      } ,     error: function(failresponse){         alert("error: went wrong" + json.stringify(failresponse));     }    }); 

problem: when testing code showing error:

uncaught syntaxerror: unexpected token <' error.

any suggestions? thanks


Comments

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -