This article is a mirror article of machine translation, please click here to jump to the original article.

View: 14499|Reply: 0

[Jquery] jQuery JSONP cross-domain practice

[Copy link]
Posted on 2/23/2017 3:19:23 PM | | | |

First on the js code:

dataType
Type: String
The type of data returned by the expected server. If not specified, jQuery will automatically make intelligent judgments based on the MIME information of the HTTP packet, such as XML MIME type is recognized as XML. In 1.4, JSON generates a JavaScript object, and the script executes the script. The data returned by the server is then parsed according to this value and passed to the callback function. Available values:
•"xml": Returns an XML document that can be processed with jQuery.
•"html": Returns plain text HTML information; The included script tag is executed when the DOM is inserted.
•"script": Returns plain text JavaScript code. Results are not automatically cached. Unless the "cache" parameter is set. Note: On remote requests (not under the same domain), all POST requests will be turned into GET requests. (because the DOM's script tag will be used to load)
•"json": Returns JSON data.
•"jsonp": JSONP format. When calling a function in JSONP form, e.g. "myurl?callback=?" jQuery will automatically replace ? is the correct function name to execute the callback function.
•"text": Returns a plain text string


asp.net MVC Background Code:










Previous:WebConfig customizes the node and reads the data
Next:WeChat web version login to send message analysis
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com