Created
January 28, 2013 23:37
-
-
Save bayleedev/4660333 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE HTML> | |
<html> | |
<body> | |
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.js"></script> | |
<script type="text/javascript"> | |
document.parentWrite = document.write; | |
document.writeCounter = 0; | |
document.write = function(data) { | |
var id = 'writeCount' + String(this.writeCounter++); | |
this.parentWrite('<span id="' + id + '"></span>'); | |
jQuery(document).ready(function($) { | |
$('#' + id).after(data); | |
}); | |
} | |
</script> | |
<div class="adSpace"> | |
<script type="text/javascript" id="adServerBS"> | |
var foo = "<sc" + "ri\"+\"pt>alert('foobar');</s\"+\"cr" + "ipt>"; | |
document.write("<sc" + "ript>document.write(\"" + foo + "\");</scr" + "ipt>"); | |
</script> | |
</div> | |
</body> | |
</html> |
@loriopatrick I was trying to emulate some of the weird things that the ad service is doing. I split up "script" into multiple segments because the browser had issues parsing it, I didn't investigate it more since I didn't care about the emulation aspect of it.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What's the point of breaking up "script"
"<sc" + "ript>...
? Is it just an IDE parsing/syntax workaround or is there something else to it?