The video of learning is still advanced teaching in the front of the dark horse in the B station.

1. Initial Ajax

1. What is Ajax? The full name for Ajax is Asynchronous JavaScript And XML. Common: Understand how to use XMLHttpRequest to exchange data with an object server in a web page, namely Ajax.

2. Understand Ajax in jQuery. Three of the most common ways to serve Ajax requests in jQuery:

$.get() gets the data from the server

$.post() submits data from the server

$.ajax() gets or commits data from the server.

$.get() $.get()

$.get(‘url’,[data],[callback]) $.get(‘url’,[data],[callback]) Get request code implementation with no parameters:

Browser implementation:

Initiate get request code implementation with parameters:

Browser implementation:

$.post()

$.get(‘url’,[data],[callback]) $.get(‘url’,[data],[callback]) $.get(‘url’,[data],[callback]) Post request code implementation:

Browser implementation:

$.ajax()

$.ajax({

Type: ", // Request mode, GET or POST URL: Success :function(res){// call back to console.log(res)}Copy the code

})

Use $.ajax() to make a get request:

Make a POST request using the $.ajax() function:

Then make a book management case: CSS style using bootstrap, JS using jQuery.

Specific code: HTML and CSS

JavaScript part:

Gets the book list code

Click delete Book code:

Click add Book code:

conclusion

Follow the video learning feeling is not very difficult, the code or more practice will be familiar with, before the learning of HTML, CSS JavaScript used again also by the way reviewed. The most difficult code is not careful enough, often because of the wrong characters, letters appear error. This section of ajax introduction is fairly easy, continue to learn.