Using AJAX to send data to the front and back of the interaction, I think is the most basic web development skills. DZ Development recently because not compatible with jquery, so can only use native JS to send data, do not want to encounter many problems. Here is a summary of the analysis. Let's start with a case that uses Ajax to send post form data.
index1.php
<?phpif (!empty ($_post)) {echo json_encode ($_post);}
There are a few things to note.
1:ajax cannot request data across domains: When cross-domain: If the current script domain name is: locakhost/index.php, the requested URL is 127.0.0.1, the send request fails, or the server can receive the request, but xmlhttp.status= 0, the browser does not accept data returned by the server.
What is a cross-domain? Cross-domain How to send request data, this blog has a good explanation.
Http://www.cnblogs.com/rainman/archive/2011/02/20/1959325.html#m0
2: When sending a request with a For loop, Ajax can only receive the last requested data because the for loop is much faster than the speed at which a request is completed.
3: The json,php function Json_encode () and Json_decode () can only accept strings encoded in UT8 format, and no returns NULL.
Send POST request full case with native Ajax