One, jquery load an HTML page into the specified div
Load the contents of a part of the a.html into a div in b.html.
For example: Load a.html inside the <div id= "row" ></div> this div inside of all the content loaded into the b.html div <div id= "content" ></div>
With jquery Ajax you can implement
Suppose A.html and b.html in the same directory
B.html
<script >
$ (document). Ready (function () {
bodycontent = $.ajax ({
URL: "b.html",
Global:false,
type: "POST",
data: ({
id:this.getAttribute (' Row ')
}),
dataType: "html",
async: False,
success:function (msg) {
alert (msg);}})
;
</script>
Second, Juqery $.ajax request another HTML page specified "part" loaded into this page div, the focus is part of the data loaded into this page div
Large to the following ideas:
$.ajax ({
url:url,//This is the address type of the static page
: "Get",///static page with Get method, otherwise the server will throw 405 error
success:function (data) {
var result = $ (data). Find ("a specified part of another HTML page");
$ ("this page div"). html (result);
}
});
or refer to the following code:
$ (function () {
$.ajax ({
type: "POST"
URL: "Loginloadarticle.ashx",
data: "Type=" +escape ("latest announcement") ),
success:function (msg) {
$ (". Gonggao"). HTML (msg);
},
error:function (XMLHttpRequest, Textstatus, Thrownerror) {}}
})
If the parameters are not clear you can refer to
Three, jquery $.ajax () method parameter detailed explanation and application
This article uses jquery to load HTML pages to the specified div implementation method is small set to share all the content, hope to give you a reference, but also hope that we support cloud habitat community.