1. Background
The invocation of WebService interface in the ASP.net development environment using the Ajax method in jquery
2. Problems that arise
Causal analysis: The effect of the browser's homology policy (that is, JavaScript or cookies can only access content under the same domain);
3. Solution:
(1) JSONP: Only get mode is supported
(2) Cros: cross-domain resource sharing
The following are the Cros solutions:
A. Add response header information to the WebService interface:
B. Add related configuration section information to the Web.config file:
After using a or B solution, the browser header information changes as follows:
The final problem is better resolved, but for this scenario, different browser support scenarios are shown below:
The above is a small set to introduce the AJAX request WebService solution, I hope to help you, if you have any questions please give me a message, small series will promptly reply to everyone. Here also thank you very much for the cloud Habitat Community website support!