First step : establish ajax engine

var xmlhttp="";
if(window.XMLHttpRequest){
xmlhttp=new XMLHttpRequest();
}else{
xmlhttp=new ActiveXObject("microsoft.XMLHttp");
}

Second parts : Judge the state

 xmlhttp.onreadystatechange=function(){
if(xmlhttp.readyState==4&&xmlhttp.status==200){
document.getElementById("res").innerHTML=xmlhttp.responseText;
}
}

The third step : Open the data , send data

//get Open and send by 
xmlhttp.open("get","./ajaxPro.php?mark="+mark+"&&v="+v,true);
xmlhttp.send(); // use POST Open and send by
var url="./ajaxPro.php";
var data="mark="+mark+"&&v="+v;
xmlhttp.open("POST",url,true);
xmlhttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");// Have to add
xmlhttp.send(data); // Pay attention to the difference

ajax No refresh technology for more related articles

  1. What is? Ajax No refresh technology ?

    The browser instantiates a Ajax object , This object sends a HTTP request , And carry certain parameters , Transfer to the background . The background server receives these parameters , At the same time, filter the passed parameters , Make logical judgments . If database operation is needed , It's going to take out the data , format ...

  2. PHP Learning notes (16)AJAX No refresh technology -- In depth understanding of

    Ajax Inside onreadystatechange What is the role of After sending a request , The client is not sure when the request will be completed , So we need to use the event mechanism to capture the state of the request ,XMLHttpRequest The object provides onrea ...

  3. PHP Learning notes (15)PDO Database operation +AJAX Delete users without refresh technology

    pdo.php <!DOCTYPE html> <html lang="en"> <head> <meta charset="U ...

  4. About Ajax Research on non refresh paging technology c#

    About Ajax Research on non refresh paging technology c# Novice , Ask God for a better solution , Under the guidance ~ I used to do projects , Used to GridView Refresh paging for , Used it, too EasyUI Encapsulation of paging technology , Recently, new functions have been added to the old project , ...

  5. ajaxfileupload.js Plug in combined with general file processing implementation Ajax No refresh upload

    First, let's take a few pictures to show the functions to be realized more intuitively . This function is mainly through Jquery ajaxfileupload.js Plug in Integration ajaxUpFile.ashx General application processing file implementation Ajax No refresh upload function , combination NPOI2 ...

  6. Ajax.BeginForm() Realization ajax No refresh commit

    1. At the same time to install Microsoft jQuery Unobtrusive ajax and jQuery Unobtrusive Ajax, Here's the picture After the installation, the following additional js library 2. Quote the js library lay ...

  7. Mobile image upload solution localResizeIMG Compress first and then ajax No refresh upload

    Now technology is too advanced , The pixels of mobile devices are getting higher and higher , Any picture 2M+, But we need to do mobile image upload and download pc It's a little different in the world , You can't limit the image size on the mobile terminal , Let users process images first and then upload them , It's not realistic . So the solution is to upload pictures first ...

  8. Ajax No refresh commit

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...

  9. ajax No refresh paging

    //ajax No refresh paging 1. What the front desk needs to do When sliding At present page+1, adopt page ajax Request the background interface to get data and assemble the data ;2. Backstage to do Do paging interface return json The data front desk judges the trigger request condition : var p ...

Random recommendation

  1. cocos Basic course (9) Sound and sound effects

    Using sound engine We can use Cocos2d-x Self contained CocosDension Library to use the sound engine .CocosDesion It is easy to use SimpleAudioEngine class , To use it , We just need to bring in his header ...

  2. K The line refers to the calculation method of the line

    Index line calculation method l   dataDR = Kdata( Raw data )/dr( Ex right )  // The ex weight data is equal to the original data divided by DR( Ex right ) among , Japan K data Local ex right processing is required . Zhou K He Yue K The old data part of is processed by the server ...

  3. iOS Practical skills expansion - Integrated alipay

    Prelude Now with the rapid development of mobile development , Mobile payment is becoming more and more popular and indispensable . Recently, I made an application of Alipay payment function. , In the process of using Alipay , Encounter some unnecessary detours , therefore , I have written this article to sum up my experience in this field iOS How to develop and use in ...

  4. vs2013 linq to mysql

    The installation files 1. Download the installation file 2. Create project 3. establish mysql Data connection 4. newly build ADO.NET Data model Project implementation code using (WorkerContainer db = new WorkerCont ...

  5. distance VR How long will the era really come ?

    2016 The year is called VR First year , The major VR The propaganda of equipment manufacturers is overwhelming , many VR People are dazzled by the products . With the continuous advancement of the popularization process and the improvement of the penetration rate ,VR It has become the focus of attention in recent two years , Under the joint action of many fields ,VR Is the times the same ...

  6. HTML Resource locator -URL

    URL Also known as the web site . URL It can be made up of words , such as "www.baidu.com", Or internet protocol (IP) Address :192.168.1.253. URL - Uniform Res ...

  7. js Data structure stack 、 queue ( Data structure and train pulling game )

    1.js Realize the data structure of queue ( fifo ) function Queue (array) { if(Object.prototype.toString.call(array)!="[object ...

  8. SmartCode Use FAQs

    SmartCode common problem SmartCode Can do ? SmartCode = IDataSource -> IBuildTask -> IOutput => Build Ev ...

  9. win10 Change the configuration of wireless network card MAC Address

    https://blog.csdn.net/qq_31778495/article/details/80932472 Some time ago, computer network rubbing was banned MAC Address , So look for modification MAC Address method . Native configuration : win ...

  10. Java Memory area and memory overflow exception -- Run time data area

    Java And C There is a gap between the dynamic allocation of memory and garbage collection technology “ High wall ”. C.C++ Program development is in memory management area , Having every object “ ownership ”, It also takes the responsibility from the beginning to the end of each object declaration , and Java Automatic management in virtual machine ...