Document directory
- Overview
- Parameters
- Description:
Overview
Load the remote HTML file code and insert it into the Dom.
By default, the get method is used. The method is automatically converted to the post mode when additional parameters are passed. In jquery 1.2, you can specify a selector to filter loaded HTML documents. In Dom, only filtered HTML code is inserted. The syntax is like "url # Some> selector ". See the example.
Parameters
URLString
The URL of the HTML webpage to be loaded.
Data(Optional)Map, string
Key/value data sent to the server. In jquery 1.3, you can also accept a string.
Callback(Optional)Callback
Callback function when loading is successful.
Description:
Load the navigation part of the article sidebar to an unordered list.
HTML code:
<B> jquery links: </B> <ul id = "Links"> </ul>
Jquery code:
$ ("# Links"). Load ("/main_page # P-getting-started li ");
Description:
Load the content of the feeds.html file.
Jquery code:
$ ("# Feeds"). Load ("feeds.html ");
Description:
Same as above, but the additional parameters are sent in post form and the information is displayed when the request is successful.
Jquery code:
$ ("# Feeds "). load ("feeds. PHP ", {limit: 25}, function () {alert (" the last 25 entries in the feed have been loaded ");});