Handle non-string HTML passed to loadContent()

This commit is contained in:
Behind The Math
2019-03-03 01:50:18 -05:00
parent 493d56c2d0
commit 42b32a854f
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