Skip to content

Commit 2da0c56

Browse files
author
Gabriel Schulhof
committed
Make pasting inline into <script> tag possible
The browser interprets the occurrence of the literal "</script>" inside of the body of a script tag as the end of the script, so the leading "<" must be escaped by replacing it with \x3c
1 parent 77c4b35 commit 2da0c56

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

jquery.ba-hashchange.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@
370370
iframe_doc.open();
371371

372372
// Set document.domain for the Iframe document as well, if necessary.
373-
domain && iframe_doc.write( '<script>document.domain="' + domain + '"</script>' );
373+
domain && iframe_doc.write( '\x3cscript>document.domain="' + domain + '"\x3c/script>' );
374374

375375
iframe_doc.close();
376376

jquery.ba-hashchange.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)