The property method can contain parameters:
CopyCode The Code is as follows: function classx (name ){
This. Name = Name;
Classx. Prototype. Show = function (PARAM ){
Alert (this. Name + "" + PARAM );
};
}
VaR o = new classx ("name ");
O. Show
I am very happy to have you read the examples of Ajax that I have written. Whether you are your first friend or an old friend, I will show you what I have learned so far,
What Is Ajax?
Important: Ajax is not a language, but a combination of
1. [Use IFRAME]
Add an IFRAME to the page to be loaded, as shown below:
CopyCode The Code is as follows:
Add the function you want to call in onload. If the loaded page is in the pop-up layer, this function should be placed on the parent
Recently, a buddy is working on an Ajax persistent connection project. The page needs to maintain a persistent connection with the server and request a connection again after the connection times out. During the process, he asked me what to use, I
Floating layout: a column in the HTML structure. It is floating.
I. Function Analysis:
1. Determine whether the image enters the visible area;2. Request server data using AJAX;3. broadcast the data to the corresponding queue;
II. Implementation
1. AJAX-ZOOM
A very powerful plug-in that allows you to zoom in and out with the scroll wheel of the mouse, rotate at 360 °, browse in full screen, and perform online demonstrations.
2. VerticalSlider
A good way to display the long list,
In layman's terms, Ajax is a kind of Web Page-free technology to improve user experience. Ajax is not a new technology, but it is only popular in those years, brother knows only chat qq), so it is highly regarded; of course, those years began to
First, declare the following:
1. If I feel very elementary, I will install 13. Don't "spray" me!
2. If there are any mistakes, I hope you can correct them and consult them modestly;
3. This is just a saying of the family. I have experience and have
Methods In Ajax engine objects:
Abort () stops the current request
GetAllResponseHeaders () returns the complete headers as a string.
GetResponseHeader ("headerLabel") returns a single header label as a string
Open ("method", "URL" [, asyncFlag [
(Default: true) by default, all requests are asynchronous requests. To send a synchronization request, set this option to false. Note: The synchronous request locks the browser. Other operations can be performed only after the request is completed.
Copy codeThe Code is as follows :/*
GET and POST methods that prevent repeated ajax requests
*/
JQuery. extend ({
Getx: function (url, data, callback, sender ){
Var params = {url: url, data: null, callback: null, sender: null };
For (var I = 1; I If
Let's start with some basic knowledge:
Syntax: $. ajax ({option })
Option indicates the parameter. In the form of key/value.
Common parameters: type: post/get.
Url: the address where the request is sent.
Data: {object: object} the data sent to the
I. Use iframe to generate history through document. write
Copy codeThe Code is as follows:
0
0
Click the button to update the page DOM (simulate ajax submission). the browser's back button is available. Click Back to return to the
(I am afraid that I will forget to use it later, so I don't have much explanation. If I really don't understand it, follow my code to give it a try)
I use php at the backend. One of the main functions of the following code is to provide an interface
For example:
Copy codeThe Code is as follows: function xmlHttpR (){
Var xmlhttp;
If (window. XMLHttpRequest ){
Xmlhttp = new XMLHttpRequest ();
}
Else {
Try {xmlhttp = new ActiveXObject ("Msxml2.XMLHTTP ")}
Catch (e ){
Try {xmlhttp = new
Some pages that are frequently used by AJAX are sometimes not dare to be refreshed, because after refreshing, you may see a very different page from the original one. I will not discuss whether to use AJAX in the case of a large number of page
Cross-origin operations of Ajax have always been a problem. Currently, the main solutions include:
1. JSONP (must be supported on the server)
2. IFrame (operations can only be performed between subdomains)
3. Page proxy (this is omnipotent)
4.
For more information about Ajax submission, see here.
Because of code problems, the script house has been corrected. You are welcome to test it.
Xmlns = "http://www.w3.org/1999/xhtml">
Try to submit a few more messages ......
Show message
Especially after the popularity of Jquery, porotype, Ext and other frameworks, a large amount of simplified code can be said to bring the gospel to programmers,
Free from the heavy work of code, you can easily implement the complex functions of
That is, when the onchange event in the regional drop-down box is triggered, the options of the agent drop-down box are changed accordingly. For example, if you select Hunan> Changsha, the agent drop-down box only displays the agent in Changsha.
I
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