mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-09 11:13:57 +08:00
Add definition and test for $.pjax function.
This commit is contained in:
@@ -8,6 +8,14 @@ function test_fn_pjax() {
|
||||
$(document).pjax("a", "#pjax-container", { push: true });
|
||||
}
|
||||
|
||||
function test_pjax() {
|
||||
$.pjax();
|
||||
$.pjax({
|
||||
url: "hello.html",
|
||||
container: "#main"
|
||||
});
|
||||
}
|
||||
|
||||
function test_click() {
|
||||
var event = $.Event("click");
|
||||
$.pjax.click(event, "#pjax-container");
|
||||
|
||||
Vendored
+10
@@ -58,6 +58,16 @@ interface JQueryStatic {
|
||||
}
|
||||
|
||||
interface PjaxStatic {
|
||||
/**
|
||||
* Loads a URL with ajax, puts the response body inside a container, then pushState()'s the loaded URL.
|
||||
* Works just like $.ajax in that it accepts a jQuery ajax settings object (with keys like url, type, data, etc).
|
||||
* @param options PJAX settings, which is a superset of jQuery AJAX settings. It includes the following specific options:
|
||||
* - container: a jQuery selector indicates where to stick the response body. E.g., $(container).html(xhr.responseBody).
|
||||
* - push: a boolean indicates whether to pushState the URL. Default is true.
|
||||
* - replace: a boolean indicates whether to use replaceState instead of pushState. Default is false.
|
||||
*/
|
||||
(options?: PjaxSettings): JQueryXHR;
|
||||
|
||||
/**
|
||||
* PJAX on click handler.
|
||||
* @param event A jQuery click event.
|
||||
|
||||
Reference in New Issue
Block a user