I used to meet this kind of demand in my project. Users want to be able to directly enter the city's name, they can get the city's corresponding information. You used to generate a few JavaScript arrays when the page was open, and then contrast that.
Today in the dream of the light of the blog saw an AJAX hack demonstration, in fact, across the station found very easy, but to do great harm or difficult, secretly cookies and what only for users, XSS worm that use is terrible.
Let's take a look
It's easier to use the Smarty template here
The main technology of this article: Ajax,php,smarty, and also encapsulates a very simple class
Class:
(function () {function $ (id) {return document.getElementById (ID);} $.init=function ()
In the essentials of Ajax development, I built two simple, comprehensive examples. One is to support the addition, deletion, change, fuzzy search of the simple guest book, and the other is to simulate the MSN space provided log comments, fixed links,
Rss.js
Copy Code code as follows:
Control ID
function GetId (ObjID) {
return document.getElementById (ObjID)
}
Links corresponding to the array, please indicate reproduced from Http://www.cnrui.cn/blog
function Urlarrary (urlname) {
### #JavaScript的AJax
Ajax is "Asynchronous JavaScript and XML" (Asynchronous JavaScript and XML)An important technique used in designing Ajax is the XMLHttpRequest object.
How to create a XMLHttpRequest object:
XMLHTTP = new Activeobject
A Web site using AJAX technology, not only can improve the user experience of the site, but also greatly save valuable bandwidth, reduce the server load (no longer need to interact with the entire Web page content, but local).
Today, share an
From just contact B/s development, have heard of Ajax technology, but has been in ambiguous state, the truth understand, one to the hands of the dumbfounded.
Ajax seems to be unfathomable technology, become a B/s learning process in a shadow.
The Readystae status is described in the pragmatic Ajax A Web 2.0 Primer, selected passage as follows:
0: (uninitialized) the Send () method has not yet been invoked.
1: (Loading) the Send () method has been invoked and request in progress.
2:
Project code structure See what I wrote earlier [Ext/fckeditor integration--AJAX UI--a new way of thinking about web development, changing ideas in time].
In the
├─taskofpig
│├─controller
│├─dao
│├─js
│├─music
│├─tpl
│├─tpl_c
│└─_log
The project
Basic usage:
Copy Code code as follows:
var ajax = new Ajaxobj (URL);
Ajax.addlistener function (r) {
Alert (R);
});
Ajax.send ();
You can also call continuously:
Copy Code code as follows:
var ajax
Core Ajax (options) functions, including the establishment of XMLHttpRequest, data extraction, to determine whether the return to success, and so on, basically meet the day-to-day needs.
Copy Code code as follows:
A generic function for
Ajax technology is the crystallization of a variety of computer technology, its name comes from: asynchronism (asynchronous), JavaScript, and, XML, the first letter of 4 words, that is, asynchronous JavaScript request processing XML technology. The
JSON and JSONP
Jsonp and JSON like, what's the connection between them?
JSON (JavaScript Object notation) is a lightweight data interchange format. For the JSON everyone should be very familiar with it, not very clear friends can go to the
In Django, using jquery Ajax post data, there is a 403 error
Method One:
If you use jquery to handle Ajax, Django sends a problem-solving code directly. Put it in a separate JS file, in the HTML page can be introduced. Note that this JS file must
This article analyzes the difference between using GET and post mode for Ajax. Share to everyone for your reference. The specific analysis is as follows:
If the request is a get mode, the pass parameter is sent to the server side via the URL
The example of this article explains the jquery $.ajax () method parameters for your reference, the specific contents are as follows
$.ajax ({
URL: ' test.do ',
data:{id:123,name: ' Xiaoming '},
type: ' Post ',
dataType: ' JSON '
This article will show you the philosophy of jquery, explore his features and features, and do some Ajax examples and how to use Plug-in (Plug-ins) to extend jquery.
1. What is jquery?
jquery is a very good JavaScript library, it was born in 2006
When using jquery to implement Ajax in ASP.net, aspx,ashx can be used on the server side, as well as webservice. Recently studied the WebService mode, the jquery Ajax method calls the jquery Ajax method call asp.net WebService Detailed instance code
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.