indexes :

One 、AJAX The concept of
Two 、POST && GET
3、 ... and 、 Native implementation AJAX A simple example

3.1 Implementation code
3.2 Key points
Four 、 Frame hidden fields

4.1 Basic concepts
4.2 Write scripts in the background
4.3 JS Active judgement Iframe Changes
4.4 Form submission data combat
5、 ... and 、JQ Of AJAX
5.1 load()
5.2 $.get()
5.3 $.post()
5.4 $.getScript()
5.5 $.getJson()
5.6 $.ajax()
a. Common attribute descriptions
b. Common event descriptions
c. Global event description
d. $.ajaxSetup()
5.7 AJAX The second encapsulation of
5.8 Serializing forms
6、 ... and 、JSONP The concept of
6.1 JSONP The concept of
6.2 Self encapsulated JSONP
6.3 JQ Of JSONP Use .

One 、AJAX The concept of

AJAX(Asynchronous JavaScript And XML) Chinese translation is “ Asynchronous JavaScript and XML”.
AJAX In fact, it is the technology obtained by integrating various existing technologies . It includes :
1) XMLHttpRequset: Browser's XMLHttpRequset object , This object is used to send requests and receive responses to the background .
2) JavaScript :  Used to receive 、 Handle 、 Show XMLHttpRequest The content of the response .
3) XML : (Extensible Mrakup Language) Extended Markup Language , It provides for a unified , Cross platform and system text markup format , And in the AJAX It is used for data format definition of front end and back end , But actually , Now few people use this format for data transmission , It's more about adoption JSON Data lattice                   type , In contrast, the former has more redundant code to describe the data structure , But the structure is clear .
As I said before AJAX It's not a new technology , It's the integration of existing technologies , Actually AJAX Core technologies XMLHttpRequest It was Microsoft that took the lead in IE5.0 On the browser , It's just that at that time one value took this function as a ActiveXObject The plug-in uses , stay IE After realizing this function , Other browsers , Such as google、firefox And so on have also realized this function in their own way , But this function is not valued by users , Until 2005 Google in its Google Map and Google Gmail And so on , Just let AJAX Technology is really catching on .
AJAX The basic function of will is , When the user makes a request on the front page , The request will be XMLHttpRequest Object to the background , The background receives the request and processes it , And the results in accordance with the prescribed data format , Resend to front end , After receiving the result data in response to the current end page , Will use JS Parse the data 、 Handle 、 Display, etc .


All in all ,AJAX The essence of technology is : Realize page no refresh, data dynamic change .
Compared with the previous need to refresh the page or jump the link to get the response data ,AJAX It has the following advantages :
+ No refresh data acquisition , Improve user experience .
+ Reduce server bandwidth
+ The tight coupling between the back end and the front end
But the above advantages , It can also lead to the use of AJAX Disadvantages of Technology
+ Break the browser's “ Forward ”,“ back off ” Button
+ For search engines SEO Support is not good .

Two 、POST && GET

POST And GET All are HTTP One of the ways to request . And the request mode determines the different ways of parameter transmission and data acquisition .
here , We just need to know and understand POST And GET The difference in the application layer is enough .
·  GET The request will follow the parameters URL And then deliver , and POST The request is for HTTP The physical content of the message is sent to WEB The server .
·  GET There is a limit on the size of the data ( Usually not greater than 2KB), and POST Upload data , Theoretically unlimited .
·  GET The data transmitted in this way will be cached by the browser , Therefore use GET How to transfer accounts , Passwords and so on , There will be a lot of risk .
·  GET The way and POST The access of data transmitted in different ways on the server side is also different . stay PHP in ,GET The data in this way can be $_GET[] obtain , and POST It is $_POST[] obtain , But both can be used $_REQUEST[] obtain .

3、 ... and 、 Native implementation AJAX A simple example

3.1 Implementation code

·   The front-end code ·

 function ajaxGetData(params){
var xhr = null, // Create acceptance XMLHttpRequest Object variables 
method = params.method && params.method.toUpperCase() || 'POST',
url = params.url || '',
data = params.data || null,
async = params.async || true, // Asynchronous or synchronous , Default asynchronous .
callback = params.callback || function(){}; if(window.XMLHttpRequest){ // solve XMLHttpRequest Object compatibility
xhr = new XMLHttpRequest();
}else if(window.ActiveXObject){ // If it is IE6.0 Previous , Then, then, then, adopt ActiveXObject object .
xhr = new ActiveXObject('Microsoft.XMLHTTP');
}else{
return false; // If the browser doesn't support this feature , Then stop the program from running .
} if(method === 'POST'){
xhr.open('POST',url,async);
xhr.setRequestHeader('Content-Type','application/x-www-form-urlencoded');//POST Submit data , Special head
xhr.send(data); // Send a request , And add data , If there is no data , Default ,null
} if(method === 'GET'){
(data)?'':data = '';
xhr.open('GET',encodeURI(url+'?'+data),async); //GET request , adopt URL Additional data transfer . And by coding , Can solve IE6/7 stay GET The Chinese parameters are garbled in transmission mode . Backstage can be through urldecode($_GET['a']) decode
xhr.send(null);
} xhr.onreadystatechange=function(){ // Register the callback function of the request .
if(xhr.readyState == 4 && xhr.status == 200){ //readyState This is the status of the request ,4 Indicates that the request was successful . status Indicates the state of response or data transmission .200 Indicates that the data transmission is successful .
callback(xhr);
}
} }

· Back end code ·

 <?php
$v1 = $_REQUEST['v1'];
$v2 = $_REQUEST['v2'];
echo ($v1+$v2);
?>

· Call mode ·

 elem.onclick=function(){
ajaxGetData({
url:'index.php',
method:'get',
data:'v1=1&v2=2',
async:true,
callback:function(xhr){
alert(xhr.responseText);
}
});
};

3.2 Key points

· ActiveXObject
ActiveX Plug ins can be exchanged with other Microsoft components , Including here I need Microsoft's own HTTP Request method .
new ActiveXObjcet('Microsoft.XMLHTTP') IE5.0+ Supported by HTTP Request method .

· setRequestHeader
This method can set the header information of the request , Commonly used post Method to submit data to a dynamic web page file . This is because PHP Medium $_POST['key'] Method , You need to use the format of key value pairs , So you have to declare that the type of the request is : setRequestHeader('Content-Type','application/x-www-form- urlencoded') Send data to the server in the form of submitting data .

· readyState && status
readyState Express HTTP The running state of the request , Whether or not the requested data is found , They all go through the following process :
0 ---- Request initialization , resume xhr object .
1 ---- Establish a connection with the server ,open() Method has been successfully called .
2 ---- The request has been received
3 ---- The request is being processed
4 ---- Request processing complete

status It means that HTTP The status of the requested data [ Common feedback codes ]:

200 ---- Data request complete , Already available .
404 ---- Page not found .

· open

  function : Initialize the parameters of the request .
Format :open(' How to request data ',' The page to be requested URL',' Asynchronous or not ');
explain :
· How to request data :GET | POST
· Asynchronous or not :true( asynchronous ) | false( Sync )
* If there is setRequestHeader() Method , Must put open() Method in the line before it .

. send
  function : Send a request .
Format :send(params)
Code example :
send(null)
// stay GET In this way , Because the parameter will be in the open Method is attached to URL And then transmit .

send('fname= god &lname= Menstrual diseases ')
// stay POST The way , Parameters are transmitted in this way , But remember to use setRequestHeader() Method .

. Synchronous and asynchronous
xmlHttpReq Object's open() The third parameter of the method can set the synchronous or asynchronous mode .
true - Expressed as asynchronous , It doesn't wait for the execution of the server to complete .
false - Synchronous representation , It will wait for the server execution to complete , Otherwise, the program will be suspended , Have been waiting for , Generally, synchronization is not recommended , However, some small programs can still be used .

· Use timestamps or random numbers to ensure that there is no cached request data
// Time stamp
 open('GET','index.php?t='+ new Date()*1,true);

// random number
 open('GET','index.php?m='+ Math.random(),true);

Four 、 Frame hidden fields

4.1  Basic concepts

“ Frame hidden fields ” technology , Now it is mainly used for uploading files , because AJAX technology , Unable to upload files .
  stay AJAX Before the technology was put forward , If you want to commit or change data without refreshing , It's usually passed “ Frame hidden fields ” To achieve .
“ Frame hidden fields ” The basic idea is : The page will have a blank Iframe, adopt display:none To hide , And then when the data needs to change , By designation iframe Of src value , Make it jump to the requested page . Then transfer the value to the background , So page refresh , It will also be hidden iframe In the middle of , The current window page will not be refreshed . Finally, the parent page is going to get the hidden iframe The result in is just , such , It's done by hiding iframe Method to achieve no refresh data submission or change .

Generally speaking , adopt iframe Achieve no refresh , There are mainly the following methods :

Take the value as url The parameter is attached to iframe Of src in .
stay iframe Put a form in , And then let iframe Submit the form in
Change the form element of the parent page to target Value specified as iframe Of name value .

And the parent page gets hidden iframe The way to request results , There are the following :

+ adopt onload, or JQ Of load Method to read the changed iframe Value , One thing to remember is ,onload The event must be in iframe Bind before you change .
+ Backstage results in a period of JavaScript Code , Changing the code will call back the specified method of the parent page , And transmit the result of the request :
 echo '<script>callback(' Data submitted successfully ')</script>'

4.2  Write scripts in the background

· The front-end code ·

 <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
</head>
<body>
<button>click</button>
<iframe id="ifr" src="" style="display:none" frameborder="0"></iframe>
</body>
</html>
<script>
var btn = document.getElementsByTagName('button')[0],
ifr = document.getElementById('ifr');
btn.onclick=function(){
ifr.src="index.php?v=success?"+new Date().getTime(); // Add a time stamp
}
</script>

· Back end code ·

 <?php
$v = $_REQUEST['v'];
echo '<script>alert("'.$v.'")</script>';
?>

4.3 JS Active judgement Iframe Changes

· The front-end code ·

 <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
</head>
<body>
<button>click</button>
<iframe id="ifr" src="" style="display:none" frameborder="0"></iframe>
</body>
</html>
<script>
var btn = document.getElementsByTagName('button')[0],
ifr = document.getElementById('ifr'); function load(obj,fn){ obj.isloaded = false;
obj.onreadystatechange=function(){
if(this.readyState == 'complete'){
if(!this.isloaded){
this.isloaded = true;
fn && fn();
}
}
};
obj.onload=function(){
if(!this.isloaded){
this.isloaded = true;
fn && fn();
}
}; } btn.onclick=function(){ load(ifr,function(){alert(ifr.contentWindow.document.body.innerHTML)});
ifr.src='index.php?'+new Date().getTime()+'&v=success'; }; </script>

· Back end code ·

 <?php
$v = $_REQUEST['v'];
sleep(5);
echo 'success';
?>

4.4  Form submission data combat

· The front-end code ·

 <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
</head>
<body>
<form action="index.php" method="post" target="MyIframe">
<input type="text" name="v" />
<input type="button" id="btn" value="SubMit" />
</form>
<iframe id="ifr" style="display:none" frameborder="0" name="MyIframe"></iframe>
</body>
</html>
<script>
var btn = document.getElementById('btn'),
ifr = document.getElementById('ifr'); function load(obj,fn){ obj.isOpen = false;
obj.onreadystatechange=function(){
if(this.readyState == 'complete'){
if(!this.isOpen){
this.isOpen = true;
fn && fn();
}
}
};
obj.onload=function(){
if(!this.isOpen){
this.isOpen = true;
fn && fn();
}
}; } btn.onclick=function(){
document.forms[0].submit();
load(ifr,function(){alert(ifr.contentWindow.document.body.innerHTML)}); }; </script>

attach : About  load()  Method description , see :http://www.cnblogs.com/HCJJ/p/5493821.html

5、 ... and 、JQ Of AJAX

5.1 load()

load The method is JQ The simplest and most commonly used Ajax Method . It defaults to GET request , Using an asynchronous approach , Often used to request some static resources , for example HTML file , Then insert it into the specified DOM in .
load Method can also specify request parameters and callback functions , Once the request parameters are specified , that load The method will be POST Mode request page .
A complete load Methods use the format :
 load(url,params,callback); 
url : It's the requested page url Address . If the requested page is a html file , So it can be url Leave a space behind and attach a selector , You can specify what to return ,
params : Parameters passed on request , If the parameter is an object , that load Will use POST Mode request , If the parameter is a string in the form of a set of key value pairs , Then we will adopt GET request .
callback(data,status,xhr) : Callback function at request completion . It should be noted that load Callback function for method , Whether the request succeeds or fails , As long as the request is complete, it triggers .
data : The value of the request completion .
status : Status of request
xhr : XMLHttpRequest object .

Example :

 $('div').load('news.html .para'); // Additional selectors 
$('div').load('index.php','v=v1') // Additional parameters ,GET request
$('div').load('index.php',{v:'v1'}) // Additional parameters ,POST request
$('div').load('index.php',{v:'v1'},function(data){$(this).html(data)})

5.2 $.get()

$.get() Methods use GET Way to make asynchronous requests .
 $.get(url,params,callback) 
params : Parameters transmitted on request , It can be in the form of an object , It can also be a serialized string .
Object format :{v:'v1'}
Serialized string :'v=v1&v2=v2';
callback(data,status,xhr) : Pay attention to is , This function will only be triggered after the request is successful .
Example :
     $.get('index.php',{v:'v1'},function(data){alert(data)})

5.3 $.post()

$.post() Methods use POST Asynchronous requests are made in the same way .
 $.post(url,params,callback);

5.4 $.getScript()

$.getScript() The method will pass GET Method to request a script file , And execute the script code .
 $.getScript(url,callback); 
  url : Script file url
  callback(data,status): Callback function after request ,data It's the content of the script , and status Is the status of the request .

5.5 $.getJson()

$.getJson() And $.getScript() In the same way , however $.getJson() Method is specifically used to request json file .
 $.getJson(url,callback); 
   url : json Of documents url
  callback(data): Callback function after request ,data It's the response data .

5.6 $.ajax()

$.ajax() The method is JQ The bottom of the middle AJAX Method , All of the above is based on $.ajax Implemented .
Study $.ajax() Method , We can start from two basic points , It's attributes and events .

a. Common attribute descriptions :

url:[str]: Specify the url.
type:[str]: Set the mode of request , yes get still post.
dataType[str]: Set the expected background return data format .JQ According to your designation dataType Type for data parsing , So if you're not sure about the data type , This place can be left blank , The default is JQ Automatic judgment .
data:[str | obj]: Specify the data parameters to be transferred to the background .
async:[boolean]: Set whether the request is synchronous or asynchronous , The default is asynchronous .
global:[boolean]: Set whether to turn on AJAX The overall situation of .
timeout:[number]: Set timeout . Once the background response time exceeds timeout Value , that AJAX It will jump to error Incident , also error In the event xhr object , There will be one. statusText Property returns a value of timeout.
error:function(xhr){
if(xhr.statusText == 'timeout'){
alert(' request timeout , Please try again !');
}
}
jsonp:[str] : The background will get the callback function name according to this value .

b. Common event descriptions :

complete: When AJAX The event triggered when the request is completed .
success: When AJAX The event triggered when the request is completed and successful .
error: When AJAX Event triggered after a request fails .
beforeSend: stay AJAX Prepare to send events triggered before . In the handler of the event , But for the present AJAX Of options Make one last change .
beforeSend:function(event,xhr){
xhr.type = 'get';
xhr.url = 'xxx.php';
event.success:function(){ };
}

c. Global event description :

When there is any ajax These specific global events will be triggered when requested ajax Event handler .
overall situation AJAX Registration and execution of event handling functions , They all have a specific order .

Pictured :

among :ajaxSend、ajaxSuccess、ajaxError、ajaxComplete Can be used by all of the AJAX request , and ajaxStart、ajaxStop It will only be triggered once .

Sample code :

 var start = 0,
send = 0;
$(document).ajaxStart(function(){
start++;
});
$(document).ajaxSend(function(){
send++;
});
$.ajaxSetup({'async':false});
$.ajax({...}) //ajax1;
$.ajax({...}) //ajax2; console.log(start); // --> 1;
console.log(send); // --> 2;

because ajaxSart() Will be triggered when the first request on the page is initiated ,ajaxStop() Will be triggered at the end of the last request , So they are often combined to show loading Waiting box, etc . To deal with a group of ajax request .

Another thing to note is :

  • Global events will never run in cross domain scripts , No more JSONP Run on request .
  • stay jQuery1.8 above , All the big picture ajax The event handler must be bound to document On , That is to say $(document).ajaxEvent()
  • Only in $.ajax() Or $.ajaxSetup() Medium globle Set to true Can be used ajax Global function ,false Will not be able to use .

Here's a detailed description of each AJAX The overall situation of :

· ajaxStart() 

ajax The overall situation of .ajax When the request starts to send .
The event handler is not triggered continuously .
Format :

 $(document).ajaxStart(function(e){
if(e.type === 'ajaxStart'){
alert('ajax Request start !');
}
});

*  e: Event object .

· ajaxSend()

ajax The overall situation of .ajax Execute when request is sent .
The event handler is continuously triggered .
Format :  $(document).ajaxSend(function(e,xhr,opt){});

* e: Event object .
* xhr:XMLHttpRequest object .
* opt:ajax Parameter options .

· ajaxSuccess()

ajax The overall situation of .ajax Execute on request success .
The event handler is continuously triggered .
Format : $(document).ajaxSuccess(function(e,xhr,opt,res){});

* e: Event object .
* xhr:XMLHttpRequest object .
* opt:ajax Parameter options .
* res:ajax After the request response The value returned .

· ajaxError()

ajax The overall situation of .ajax Please execute on failure .
The event handler is continuously triggered .
Format : $(document).ajaxError(function(e,xhr,opt,exc){});

* e: Event object .
* xhr:XMLHttpRequest object .
* opt:ajax Parameter options .
* exc: Reasons for failure . Common values :Not Found

· ajaxComplete()

ajax The overall situation of .ajax Please execute on failure .
The event handler is continuously triggered .
Format : $(document).ajaxError(function(e,xhr,opt){});

* e: Event object .
* xhr:XMLHttpRequest object .
* opt:ajax Parameter options .

· ajaxStop()

ajax The overall situation of .ajax Execute when request stops .
Format :

 $(document).ajaxStop(function(e){
if(e.type === 'ajaxStop'){
alert('ajax End of request !');
}
});

d. $.ajaxSetup()

stay JQ Of AJAX in , One more $.ajaxSetup Method , It can be set globally AJAX Default parameter options for .
Example :

 $.ajaxSetup({
url:'index.php',
type:'post',
dataType:'json',
error:function(){alert('error!!')}
}); oBtn.onclick=function(){
$.ajax({
success:function(){
alert('success');
}
});
}

5.7  A self encapsulated one Ajax

Again AJAX On the basis of encapsulation again , The aim is to reduce writing AJAX Redundancy of code .

 function ajaxGetData(_url,_data,fn,_async){
$.ajax({
type:'post',
url:_url,
async:!_async,
dataType:'json',
data:_data,
success:function(data){
fn && fn(data);
},
error:function(){
alert(' Interface request failed , Failed address :'+ _url);
}
});
}

5.8  serialize

Used in the past AJAX One way background transmission parameters combined with table , We need to use JS Looking for form control elements one by one , And then attach another value to AJAX On the request . This can be used for forms with only a few fields . But if form elements get more complex , This method is inflexible .
Jquery To solve this common operation , The following simple methods are provided , They can be serialized and JSON format form The value of the form element .
 serialize()  - Serialize the values of form elements . So called serialization , That is to say k=v Key value pair format and pass & The string that makes the connection .
 serializeArray()  - This method does not return the value of the string . Instead, serialize the value of the form element into a Json Formatted data .
Example :

 $(form).serialize(); //name1=v1&name2=v2
$(form).serializeArray(); //[{name:name1,v:v1},{name:name2,v:v2}]

To achieve serialize The core function of the method , It is JQ Of $.param().
 $.params()  Method , You can turn a common object sequence into a key value pair format string and return .
Example : $.params({'key':'value'}); // 'key=value'

6、 ... and 、JSONP

6.1 JSONP The concept of

JSONP(JavaScript Object Notaction With Padding) Is to adopt JSON Format represents data and is a data transmission method mutually agreed by developers of both sides , The protocol is not an open standard protocol . It's just a mutually agreed usage .
JSONP Mainly to make use of HTML - script Tags can solve the problem of cross domain data transmission and exchange .( It actually contains src Attribute HTML Mark , They are all cross domain ).
JSONP The core idea is to pass script Tag to request the address of a background service page . Then in the background page , Will call the front end HTML A pre-defined function in the page , And the processed results are transmitted as the parameters of the function .
about script In terms of labels , It doesn't matter src Point to the url It's a *.js The file of , Or other formats , for example .php perhaps .jsp etc. , As long as the url The file you point to can return a file that matches JavaScript Syntax and format of the string can be .

JSONP The basic workflow of is shown in the figure :

JSONP The basic workflow code is as follows

·  The front-end code  ·

 <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body> </body>
</html>
<script src="http://hd.tzj.iwgame.com/js/jquery.min.js"></script>
<script> function callback(v){
alert(v);
} </script>
<script src="index.php"></script>

· Back end code ·

<?php
$v = isset($_REQUEST['v'])? $_REQUEST['v'] : '"xxx"';
echo 'callback('.$v.')';
?>

6.2 Self encapsulated JSONP

master JSONP After the concept and basic use of , Then we can encapsulate a common JSONP Method , This method can change the requirement parameters of the request to , And the callback function name is transferred to the background , Let the background automatically generate the function and result to be called back . Reduce the cost of each communication between the front end and the back end .
The specific code is as follows :

 function JSONP(params){
var url = params.url,
data = params.data,
fn = params.callback,
oScript = document.createElement('script'),
hd = document.getElementsByTagName('head')[0],
callback = 'jsonp_'+ new Date().getTime()%1e6; window[callback] = function(data){ oScript.parentNode.removeChild(oScript);
fn(data);
window[callback] = undefined;
try{delete window[callback];}catch(e){;} }; oScript.src = url+'?data='+ data + '&callback=' + callback;
hd.appendChild(oScript); }

Use as follows :

 JSONP({
'url':'index.php',
'data':'condition=lt30',
'callback':function(data){alert(data)}
});

The background code is as follows :

 <?php
$fn = isset($_REQUEST['callback'])? $_REQUEST['callback'] : '';
$data = isset($_REQUEST['data'])? $_REQUEST['data'] : '';
if($fn){
echo ''.$fn.'("'.$data.'")';
}
?>

6.3 JQ Of JSONP Use .

Let's take a look at , be based on $.ajax() Method JSONP request .

1 $.ajax({
2 type:'get',
3 url:'index.php',
4 dataType:'jsonp', // Specifies that the expected return result is a JSONP
5 jsonp:'callback', // Specify the background through callback Parameter to receive JQ I created a callback function name .
6 data:'data=x',
7 success:function(data){alert(data)}
8 });

Finally, let's sum up ,JSONP Request and traditional AJAX Differences in requests , Help us better distinguish and understand these two mechanisms .
1. AJAX Is based on XMLHttpRequest And limited by the homology strategy , and JSONP Is based on Script label , Cross domain data exchange protocol .
2. AJAX The core is XMLHttpRequest, It's a standardized protocol , and JSONP It's a kind of mutually agreed non-public agreement .

from AJAX To JSONP More articles on basic learning of

  1. JS AJAX and JSONP Basic function encapsulation and use examples of ;

    1. Code : function ajax(options){ options = options || {}; options.type = options.type || "get" ...

  2. ASP.NET MVC Based on learning

    ASP.NET MVC Based on learning Conventional MVC Concept Model : Group class , Describes the data to be processed and the business rules for modifying and manipulating the data View : Define how the user interface of the application is displayed controller : A set of classes , It's used to process information from users , The whole application flow and ...

  3. web Front end basic learning route

    1.HTML and CSS Basic knowledge of , Complete the preliminary design of the web page 2.JavaScript Basic knowledge and DOM.BOM Learning from 3. Front end infrastructure :CSS frame Bootstrap.JavaScript frame jquery The familiarity of makes ...

  4. 06: AJAX full set &amp; jsonp Cross domain AJAX

    Catalog : 1.1 AJAX Introduce 1.2 jQuery AJAX( The first one is ) 1.3 Native ajax( The second kind ) 1.4 iframe“ false ”AJAX( The third kind of ) 1.5 jsonp Cross-domain request 1.6 stay tornad ...

  5. Python web frame Tornado( One ) Based on learning

    summary Tornado  yes  FriendFeed  The extensible non blocking web Open source versions of servers and related tools . This Web The frame looks a bit like web.py  perhaps  Google Of webapp, But for ...

  6. handlebars.js Basic study notes

    Recently, I'm doing a course website for my school , Someone recommended it jquery+ajax+handlebars Make the front end of the website , I just found that it's very tall , So I wrote down some basic study notes . 1. References : jquery.js File download :h ...

  7. ajax and jsonp It's not the same thing Read in detail

    because Sencha Touch 2 The characteristics of this development model , Basically, its native data interaction behavior can only be realized through AJAX To achieve . Yes, of course , By calling the powerful PhoneGap Plug in and package , You can achieve 100% Of Socket Communications ...

  8. JAVA Based on learning - Set three -Map、HashMap,TreeMap And commonly used API

    Forest forest A piece of cultivation , A harvest Blog Garden home page New essay contact management subscribe essays - 397  article - 0  Comment on - 78  JAVA Based on learning day16-- Set three -Map.HashMap,TreeMap And commonly used A ...

  9. Vue – Based on learning (1): Understanding of life cycle and hook function

    One . brief introduction First of all, I'd like to post some comments on life cycle on the official website / Hook function description ( Post it first as a compliment ): All life cycle hooks are automatically bound  this  Context to instance , So you can access the data , Operate on properties and methods . This means that you can't use the arrow function to define a life cycle ...

Random recommendation

  1. jq When getting the width of an element , How to get the fractional part

    <!DOCTYPE html> <html> <head> <title></title> <meta name="arti ...

  2. 【jQuery】jQuery Filter rules

    Reprinted from :http://blog.csdn.net/lijinwei112/article/details/6938134 Add variables to the filter var ac = "select_" + ...

  3. add to service To SystemService Hardware Services

    add to service To SystemService: Add hardware Services . Creation time :2015 year 3 month 9 Japan ( Monday ) evening 11:07 |  classification : Hardware drivers Android | The weather :  Modification time :2015 year 3 month 10 Japan ( ...

  4. 【Java Threads 】 Locking mechanism :synchronized、Lock、Condition

    http://www.infoq.com/cn/articles/java-memory-model-5  In depth understanding of Java Memory model ( 5、 ... and )—— lock http://www.ibm.com/develope ...

  5. MySQL stored procedure (PROCEDURE)( Two )

    One . Changes to stored procedures : grammar :  ALTER {PROCEDURE | FUNCTION} sp_name [characteristic……]  Parameter interpretation : Sp_name: Represents the name of a stored procedure or function ...

  6. Android Studio Packaging process and application installation process

    Three parts , Check items and read basic configuration ,Gradle Build,Apk Install and LaunchActivity. The app is installed on the phone , Will be copied APK The installation package to data/app Under the table of contents , Extract and scan the installation package , hold de ...

  7. Maven - Tips

    1- Maven Of Settings http://maven.apache.org/settings.html 2- Maven Setting agent Example : <proxies> <proxy&g ...

  8. 003.NFS Configure the instance

    One NFS Common service management 1.1 start-up NFS [root@imxhy ~]# systemctl start nfs #CentOS7.x The series starts [root@imxhy ~]# service nfs ...

  9. csdn music How to intercept The procedure after submission csdn The column music csdn add to music

    Han Meng Feisha   Han Yafei  313134555@qq.com  yue31313  han_meng_fei_sha csdn The column music csdn add to music ======= <embed src= ...

  10. pthread_self() Based on what to get the thread identifier ????

    #include<stdlib.h> #include<pthread.h> #include<stdio.h> #include<sched.h> # ...