Add an option to set a timeout for XHR requests (#95)

Closes #24.
This commit was merged in pull request #95.
This commit is contained in:
BehindTheMath
2018-01-07 23:56:11 -05:00
committed by GitHub
parent d3d5ef7a11
commit 6491e32437
4 changed files with 12 additions and 1 deletions

View File

@@ -158,6 +158,7 @@ Pjax.prototype = {
trigger(document, "pjax:send", options);
// Do the request
options.requestOptions.timeout = this.options.timeout
this.doRequest(href, options.requestOptions, function(html) {
// Fail if unable to load HTML via AJAX
if (html === false) {