Skip to content

Commit d3434b2

Browse files
committed
Actually remove scripts from contents
1 parent 43f8003 commit d3434b2

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

jquery.pjax.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -593,7 +593,6 @@ function extractContainer(data, xhr, options) {
593593
} else {
594594
var $head = $body = $(parseHTML(data))
595595
}
596-
obj.scripts = findAll($body, 'script[src]').remove()
597596

598597
// If response data is empty, return fast
599598
if ($body.length === 0)
@@ -632,6 +631,10 @@ function extractContainer(data, xhr, options) {
632631

633632
// Then scrub any titles from their descendents
634633
obj.contents.find('title').remove()
634+
635+
// Gather all script[src] elements
636+
obj.scripts = findAll(obj.contents, 'script[src]').remove()
637+
obj.contents = obj.contents.not(obj.scripts)
635638
}
636639

637640
// Trim any whitespace off the title

0 commit comments

Comments
 (0)