One, a new Ajax_start website
Add a Web service to your Web site (ws_start.asmx)In vs2008, adding a Web waiter becomes two files, one is the asmx file, the other is the CS file in App_Code; I think it's not good, it's not easy to manage, at least
Ajax get and Post's two submission methods, get is mainly a small amount of data submission, here I talk about the process of sending a lot of data by post method.
Here I package all the content as an XML file stream, avoid the long parameter send,
Demand:
Input parameters to the Web page, pass the parameters to the server via Ajax, and receive on the server side
1, create a new Web project, Name: Ajax
2. Modify Index.jsp
The code is as follows
User id: Transmission
3. Create
Jquery
1. What is JQuery??
JQuery is an excellent JavaScript framework, a lightweight JavaScript class library.
The core idea of JQuery is Write less,do more.
Use JQuery to be compatible with various browsers to easily handle HTML, Events, animation
problem : Through jquery encapsulation Ajax request for File upload operation, the back end has returned upload file success, the front-end reference also no problem, the browser does not have any error, but always enter the error callback, the
One: Add ajax validation to an element in a form
Two: Define AJAX validation related parameters
$.validationenginelanguage.allrules.ajaxnamecall = {
"url": "/admin/user/validate",
//"message when
It seems that Ajax is getting more and more hot, as a Web application developers if not this feeling will be outdated, and may even be in the job when the elimination of repeated. I am also a Web application developer, of course, I also want to
Turn from: http://www.open-open.com/lib/view/open1334026513327.html
Today in the project to do the remote data loading and rendering the page, until the development phase to realize the problem of Ajax Cross-domain request, vaguely remember jquery
This is often the case when implementing data interaction with the background:
1. Need to use an AJAX request background data, and to get the data and then render to the page, this time must be synchronized (Async:false).
2. However, there will be
Using XMLHttpRequest to send AJAX requests
1. Create an object:
function Createxmlhttp () {
var xmlHttp;
try{
xmlhttp= new XMLHttpRequest ();
}catch (e) {
try{
Ie
xmlhttp= new ActiveXObject ("Msxml2.xmlhttp");
}catch (e) {
try{
Ie
xmlhttp= new
Let's look at a piece of code like this:
$ (function () {
var a =0;
$.getjson (
"Student_toadd",
{Stunum:10},
function (Json,status){$.each (Json,function (i) {$ (' #stuDiv '). Append (" Student study Number:" +json[i].num+ "");}
....................
Open
Creates a new HTTP request and specifies the method, URL, and authentication information for this request
Grammar
Oxmlhttprequest.open (Bstrmethod, bstrURL, Varasync, Bstruser, bstrpassword);
Parameters
Bstrmethod
HTTP methods, for
$.ajax ({
URL: "Http://www.xxx",//requested URL address
dataType: "JSON",//The format returned is JSON
async:true,//request is asynchronous, default true is asynchronous , this is an AJAX feature
data:{"id": "value"},//parameter
The restrictions on cross-domain communication are on the browser side, which is the client, so you can make a fuss from server-side code. This is the same as the last few days gzip, the problem is very similar to the gzip stream on the server
This is the ajax.html for displaying the subject.
"Http://www.w3.org/TR/html4/strict.dtd" >
ajax Web Development Example
ajax Web Development Example
take a look at the example below and you'll probably understand how the data is done
The following is a personal understanding, please correct me in the wrong place.
Ajax basic use is mainly used to implement the Web page and the server asynchronous interaction, so that users do not feel or do not wait for the page to refresh.
The
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.