Load HTML from a remote file and inject it into the DOM.
A GET request will be performed by default - but if you pass in any extra parameters then a POST will occur.
In jQuery 1.2 you can now specify a jQuery selector in the URL. Doing so will filter the incoming HTML document, only injecting the elements that match the selector. The syntax looks something like "url #some > selector". See the examples for more information.
Arguments:
| url | String | |
|---|---|---|
| The URL of the HTML page to load. | ||
| data (Optional) | Map | |
| Key/value pairs that will be sent to the server. | ||
| callback (Optional) | Callback | |
The function called when the ajax request is complete (not necessarily success).
function (responseText, textStatus, XMLHttpRequest) {
this; // dom element
}
| ||