Unexpected token < reading xml file

后端 未结 1 913
野的像风
野的像风 2021-01-22 17:24

I\'m having a problem when i do an ajax call.

My code is :

$(\'#regLink\').click(function(event){
  event.preventDefault();
  urlLink = $(\'#regLink\').a         


        
相关标签:
1条回答
  • 2021-01-22 18:02

    Your JavaScript says to make an Ajax request using the JSONP pattern (which involves inserting a <script src="something"> element into the document instead of using XMLHttpRequest).

    The response you are getting is an XML document, not a JavaScript program following the JSONP pattern, which would be something like:

    value_of_query_string_callback_argument({ "int": 1 });
    

    You get the error because the browser is trying to execute the XML as JavaScript (which it isn't).

    Either change the response to be JSONP, or use some other method to make a cross-domain request.

    0 讨论(0)
提交回复
热议问题