Handle non-string HTML passed to loadContent() (#200)

Fixes #187.
This commit was merged in pull request #200.
This commit is contained in:
BehindTheMath
2019-03-04 09:32:27 -05:00
committed by GitHub
parent 493d56c2d0
commit 7940a6e3e5
2 changed files with 54 additions and 9 deletions

View File

@@ -117,6 +117,12 @@ Pjax.prototype = {
},
loadContent: function(html, options) {
if (typeof html !== "string") {
trigger(document, "pjax:complete pjax:error", options);
return;
}
var tmpEl = document.implementation.createHTMLDocument("pjax");
// parse HTML attributes to copy them