(i) Local events
Local event: An event that is bound in a single Ajax request object, and each Ajax request object can bind its own local events as needed. A local event is only triggered by the Ajax object that binds the event, and is a private
Summary of their own in the project to do the most is the provincial urban linkage selection.
One is the provincial urban style is the three select box, directly selected, the style is as follows:
One is the province select box exists, the city,
Use jquery to send AJAX requests, which are normal under Google's browser, but fail under IE, and the first code is this:
The code is as follows
Copy Code
This code is measured in Google Browser normal, under
Example
The code is as follows
Copy Code
jquery $.ajax $.post or $.get How to submit a checkbox value 12345
The idea is simply to take the selected values out, loop them into strings, and pass them out.
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
JS Getting Started Tutorial one (the role of web effects in AJAX example)
New Document
root node
Sub-node 1
Sub-node 2
Sub-node 3
Sub-node 4
A simple multiplication table to add annotations to achieve the 99
Step three: Send the data to the ASP script for processing.
Response.ContentType = "Text/html"Response.Charset = "GB2312" ' solve garbled problemResponse.buffer=true ' Disables cachingResponse.expires=0Dbdir= "Ajax.mdb"Set Conn=server.createobject (
For example, html code is very simple Here, the status information is displayed in html, because ajax will replace the content, to prevent loading delays, we can provide some logon instructions by default. The code is as follows:Copy code
Async is true by default, that is, asynchronous mode, $. after Ajax is executed, the following steps are continued after ajax is executed until the server returns data, triggering $. success method in Ajax. at this time, two threads are executed.
The reason is that there are multiple similar asynchronous request actions on the page. Based on the principle of improving code reusability, I encapsulated a function named getData, which receives different parameters, only obtains data and returns
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!
The code is simple, implemented by jQuery + php.JQuery code: The code is as follows:Copy code JQuery (document). ready (function ($ ){$ (". Zan"). click (function (e ){Var $ I = $ (". zan I "), $ B =$ (" "). text ("+ 1"), n = parseInt ($ I.
However, it is really not cost-effective to use a plug-in to implement such a simple function. After a hard job, we can get a code that supports caching, and also use Ajax.The first is the code: The code is as follows:Copy code Function
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