function Getxmlhttp (){var http_request; if (window. XMLHttpRequest) {Http_request = new XMLHttpRequest ();if (Http_request.overridemimetype) {Http_request.overridemimetype ("Text/xml");}}else if (window. ActiveXObject) {try {Http_request = new
Fade out effect
Here is an example of the fading effect, the following style comes from StackOverflow's A.M.K.
The code is as follows
Copy Code
. content{-webkit-animation:fadein 2s; * Safari and Chrome *
The full format of the Load method is: Load (URL, [data], [callback]),
which
URL: Refers to the address of the file to be imported.data: Optional parameters; Because load can not only import static HTML files, but also import dynamic scripts, such
return: XMLHttpRequestExecuting an asynchronous HTTP (Ajax) RequestJquery.ajax (Settings)Settingsa set the key/value pair configuration of the Ajax request. All options are optional. You can set an option that defaults to any dollar. Ajaxsetup
HTML page code
The code is as follows
Copy Code
function Errors (msg){Alert (msg);}
action.php page
The code is as follows
Copy Code
if ($input = = ") {echo " ";Exit}
So
First look at the main program code (reg.html):
The code is as follows
Copy Code
Please enter the username:
User name repeat or illegal
The code is as follows
Copy Code
In fact, sometimes you'll find that you can't use XMLHttpRequest to use XMLHttpRequest correctly. What the hell is going on here? Web 2.0 Glimpse Before delving into the code, take a look at the recent view--be sure to be very clear about the
What is AJAX?
AJAX (Asynchronous JavaScript and XML, asynchronous JavaScript and XML technology) is a new word, but the implication is that two JavaScript features exist for some time. These two functions have been neglected in the past, in Gmail,
Ajax pagination Tutorial The front-end code, the HTML part we do not speak. Start the contents of the script directly. First we define 4 global variables, respectively:
All_page: Total pages, basis for creating page numbersAll_record: Total number
Ajax is "asynchronous Web Effects and XML" (Asynchronous JavaScript and XML), AJAX is not an acronym, but a noun created by Jesse James Gaiiett, a Web development technology that creates interactive Web applications
The most important and most
encodeURIComponent will be encoded in Utf-8, under GBK encoding, can you encode it with GBK?
If you are still playing encodeuricomponent idea, then sorry, encodeURIComponent will only utf-8 code, and no other API to do other coding; but don't worry,
Welcome to Www.111cn.net. The development of this site can not be separated from your support. Thank you!
Ajax files
simple ajax effect We prepare an empty div. Fill in the returned data! All code for this instance is complete.
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
Json Ajax without refreshing paginationIn this article, I will go on to write a new page without refreshing the effect of reading data using json and binding with the page splitter.// Read data based on the current pageFunction BindCommentList (page
Similar three-level binding, but when you modify the information, bind and submit again, the value of the drop-down box will always disappear, or after the return, the value of the drop-down box will also disappear, I encountered the same problem in
You can use jquery ajax to submit a form request.Jquery download function: The code is as follows: Copy code // Download an Ajax fileJQuery. download = function (url, data, method ){//
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