JS to cross the domain, you can use:
is able to read data from other sites," he said.
The key is to see your spirit is not flexible, will not use.
Ajax to cross domain, you can use the server to other sites to take content, such as asp.net:
For the problem from the background to get the JSON data, fill the content to the Drop-down list, the code is very simple, the specific process see the code below.
Requirements:URL: Link par:id sel: dropdown list Selector
Get Drop-down List
Copy Code code as follows:
Grammar:
$ (function () {
The var callback = function (r) {//R represents the data returned by the background data.
}
$.get ("", callback); The path to write the method inside quotation marks
});
In the use of jquery processing HTML5 application, has been under the Firefox test is normal, users use pad to visit when said there are garbled,
I tried it. Sure enough, after the discovery of chrome and IE kernel is the problem, this problem set
Objective:
I see the title is very long, there are so many functions, in fact, the simplification is a function, asynchronous form submission, only in the asynchronous form submit this large function, can realize the image upload, simulation Ajax
First, some basic knowledge of JSON.
The objects in JSON are identified by "{}", and a "{}" represents an object, such as {"Areaid": "123"}, and the object's value is the form of a key-value pair (key:value).
"[]", identifies an array, and splits
The new Global Consortium strategy enables HTTP Cross-domain access, and I've been looking for a long time to solve this problem:
Only the header information returned in the servlet needs to be added
Access-control-allow-originThis can be.
For
1. Three methods1.1.load methodFunction: Add the data returned by the server directly to the DOM object that meets the requirementsEquivalent to obj.innerhtml = data returned by the serverUsage:$obj. Load (url,[request parameters]);URL: Request
Copy Code code as follows:
$.ajax ({
Async:true,//default True (asynchronous request)
Cache:true,//default True, set to False will not load request information from the browser cache.
Type: "POST",//default: Get request mode: [Post/get]
In general, when doing Ajax load, many people will not consider the need for browsers to support the forward back function, because most people do not know can be achieved.
Recently encountered this problem, after a short study, found that GitHub
Jquery
jquery default contenttype:application/x-www-form-urlencoded
This is the reason jquery is garbled, when the character set is not specified, is the use of iso-8859-1
Iso8859-1, usually called Latin-1. Latin-1 includes additional characters
Myscript.js
Copy Code code as follows:
var _autorun;
var str = new Array (' Forward what ', ' share what ', ' forwarded ', ' transferred ', ' forwarding ', ' continue to apply ', ' in no ', ' sent ', ' to forward ', ' to share ', '
Suppose this is the case in the cshtml file:
Copy Code code as follows:
Data is JSON. The action passed to is/home/myajax. The way you receive it at the action method is as follows:
Copy Code code as follows:
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service