First, jquery loads an HTML page into the specified div
Load the contents of a part of a.html into a div in b.html.
For example: Loading a.html inside the <div id= "row" ></div> this div inside all the content loaded into b.html this div <div id= "content" ></div>
With jquery Ajax you can achieve
Suppose a.html and b.html are in the same directory
B.html
1<script >2$ (document). Ready (function() {3Bodycontent =$.ajax ({4URL: "B.html",5Globalfalse,6Type: "POST",7 data: ({8Id: This. getattribute (' Row ')9 }),TenDataType: "HTML", OneAsyncfalse, ASuccessfunction(msg) { - alert (msg); - } the }) - }); -</script>
Second, Juqery $.ajax request Another HTML page of the specified "part" loaded into this page Div, focus is part of the data loaded into this page div
The big idea is as follows:
1 $.ajax ({2Url:url,//here is the address of the static page3Type: "GET",//static page with Get method, otherwise the server throws a 405 error4Successfunction(data) {5 varresult = $ (data). Find ("a specified part of another HTML page");6$ ("this page div"). HTML (result);7 8 9 }Ten});
or refer to the following code:
1$(function(){2 $.ajax ({3Type: "POST",4URL: "Loginloadarticle.ashx",5Data: "Type=" +escape ("latest announcement") ,6Successfunction(msg) {7$ (". Gonggao"). HTML (msg);8 },9Errorfunction(XMLHttpRequest, Textstatus, Thrownerror) {}Ten }) One A})
If the parameter is not clear, refer to
Third, jquery $.ajax () method parameter detailed
http://blog.csdn.net/chelen_jak/article/details/22742567
Loading an HTML page to a specified div using jquery