In this lesson we are going to talk about jQuery get method for load pages and by default jQuery refers this procedure to $.ajax method.
Load data from the server using a HTTP get request.
Load JSON encoded data from the server using a get HTTP request.
Load a java script file from the server using a HTTP get request, than execute it.
Load data from the server and place the returned HTML into the matched element.
Load data from the server using a HTTP post request.
Suppose on index page we have a link for go on about page and we want to access this about page on index page without going on it so how can we use this let see a code for doing this dynamically without touch on link or using the link.
$('body').load ('about.html');
By using this method it load about page on index page without open the about page and without use the link. But what ca we do when we want to go there with link but don't want to open about page but want to load about page on index page by just click on the link so let see the code with using preventDefault method.
Here we can increase performance of our code. In the above code we set var href for when we click on any link on index page it returns a attribute href, by doing this we don't have to need set that what page we want click. In next line code it finds the code with container div and automatically open that page where we click, i mean we don't need to tell in jQuery again and again that what page we want to display. let see the code.
So in the last example we create a new div wrap on index page for display about and contact page inside it. In script tag first we create a var wrap for set div.wrap for saving interacting with Dom. After than we write our code for display about and contact page on index page without open it and we just describe this functionality to you above very well. So this concept is very easy enjoy this lesson.