Home > front end >  Using ajax xmlHttpRequest, the responseText is empty, why?
Using ajax xmlHttpRequest, the responseText is empty, why?

Time:09-30

ReadyStatus is 4, the status of 0, the responseText is empty, why?

CodePudding user response:

Explain, looking at W3School tutorial,

CodePudding user response:

Look at the error message of the browser

CodePudding user response:

refer to the second floor sky waves reply:
look at the error message of the browser

I according to the online tutorial set IIS, shows the browser error messages, the results don't see any error messages, your approach to some concrete? consult

CodePudding user response:

To the console in the browser to see the background that the content of the return is correct, returns the content files whether code is consistent with the current document,

CodePudding user response:

Thank solutions, using the HTML + ajax + asp, now see error messages to No 'Access - Control - Allow - Origin' header is present on the requested resource. The Origin 'null' is therefore not allowed Access. See online say need to add the response headers, but didn't find a way to add asp response headers, reference other didn't also to, how to deal with?

CodePudding user response:

reference 5 floor prog_Learner reply:
thank solutions, using the HTML + ajax + asp, now see the error information to No 'Access - Control - Allow - Origin' header is present on the requested resource. The Origin of 'null' is therefore not allowed Access. See online say need to add the response headers, but did not find a way to add asp response headers, reference other didn't also to, how to deal with?
https://blog.csdn.net/u013202238/article/details/81605842

CodePudding user response:

cited the 6th floor sky wave response:
Quote: refer to the fifth floor prog_Learner reply:

Thank solutions, using the HTML + ajax + asp, now see error messages to No 'Access - Control - Allow - Origin' header is present on the requested resource. The Origin 'null' is therefore not allowed Access. See online say need to add the response headers, but didn't find a way to add asp response headers, reference other didn't also to, how to deal with?
https://blog.csdn.net/u013202238/article/details/81605842

According to the tutorial to use shortcuts for calibration, Chrome setting to disable the cross-domain successfully only once, the browser crashes, what reason be? How to do? In addition, in fact also not familiar to the asp, as if the server not with asp tutorial, don't know what asp set response headers specific code?

CodePudding user response:

Asp set response headers
Response. AddHeader Access - Control - Allow - "Origin", "*"

CodePudding user response:

The
reference sky waves on the eighth floor response:
asp set response headers
Response. AddHeader Access - Control - Allow - "Origin", "*"

Problem has been solved, thank you very much!

CodePudding user response:

The
reference sky waves on the eighth floor response:
asp set response headers
Response. AddHeader Access - Control - Allow - "Origin", "*"

When I change the url to the XML, the same response headers problems, how to deal with this?

CodePudding user response:

Can be read with asp XML output again,
  •  Tags:  
  • Ajax
  • Related