Today in the project, the use of Kindeditor, the project's form is to use AJAX to submit data, and the previous version of the treatment of conflict, the Cup!
Before this use a relatively stupid method to solve the problem, when it is mainly not
1, and then a variety of debugging, and finally found: IE Gatekeeper, and then open $.get (). will be invoked, and then the second time the call is found again. So I infer that the problem of IE caching, the IE cache after the removal, sure enough.
jquery is a packaged JavaScript class library that has its own syntax, and I'll talk about implementing Ajax in the 3 method below jquery. Let's start with the example.
The first method of $. Post (Url,data,callback, type);
First create a new HTML
Example: Load from Test.js, the name of the JSON data accessed from the returned JSON data
$.getjson ("Test.js", function (JSON) {Alert ("JSON data:" + json.users[3].name);});
For example, loading JSON data from Test.js, and additional data
Ajax Entry Detection User name instance and implementation method
Username:
We also need a back-end page to determine if the input nickname exists (in this case, for example, PHP tutorial):
...
if (isset ($_get[' entryname ')
A method of automatic time saving for AJAX dataWindow.onload=function () {
var txtobj = document.getElementById (' txt1 ');var spanobj = document.getElementById (' s1 ');
Automatically saveTxtobj.addbehavior ("#default #userdata");
var
Use XMLHTTP Ajax to automatically save information complete JS code Function Createhttphandler () { var HttpHandler = false; @if (@_jscript_version >= 5) //JScript gives us conditional compilation, we can cope with old IE Versions. The
The example in this article describes how Ajax traverses an XML document. Share to everyone for your reference. The specific analysis is as follows:
The XMLHttpRequest object provides two properties that can be used to access the server response.
Here are three common ways to submit
Way One
Collect all user input by hand, encapsulate as large "k1=v1&k2=v2 ..." key-value pair form, use $.post (URL, DATA,FN) to submit data to server
$.ajax ({
type: ' Post ',
URL: ' notice_
Ajax
AJAX = Asynchronous JavaScript and XML (asynchronous JavaScript and XML).
AJAX is not a new programming language, but a new way of using existing standards.
AJAX is the art of exchanging data with the server and updating parts of the Web
This example for you to share the jquery Ajax File upload Instance source code for your reference, the specific contents are as follows
Project structure
Default.aspxUpload.aspxscripts/...Style.css
Effect chart
Client HTML code
;!
Ajax Operation Global Monitoring, user session failure of the solution
jquery (function ($) {
//Back up jquery Ajax method
var _ajax = $.ajax;
Rewrite the Ajax method to first determine that the login is executing the success function
$.ajax =
Two solutions to open a new window in Ajax that is blocked by the browser:
Recently, when I made a payment, I found that I was intercepted by the browser when I opened the payment window. Baidu only found that it was because I used ajax to verify
Solve the problem of returning the previous page and AJAX requests on the page, which is invalid for the Get request, and return the previous page ajax
First, let's analyze the cause of the problem.
Recently, when I was working on a project, I
In phpFor an ajax request, the value of the following expression is true. The code is as follows:Copy code $ _ SERVER ["HTTP_X_REQUESTED_WITH"] = "XMLHttpRequest" Is an environment variable of PHP.Ci solution The code is as follows:Copy code
Example! The code is as follows:Copy code * Company name: & nbsp; * Enterprise website: & nbsp; * Your Title: & nbsp; * your mobile phone: & nbsp; & nbsp; remarks: Enter other content you want to talk about!
We know that using server scripts for js can implement communication. However, the function is too simple and not flexible enough, so it still requires convenient communication like ajax. Today, the company encountered an ajax cross-origin problem
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