Skip to content

Instantly share code, notes, and snippets.

@fjakobs
Created November 11, 2010 08:31
Show Gist options
  • Save fjakobs/672203 to your computer and use it in GitHub Desktop.
Save fjakobs/672203 to your computer and use it in GitHub Desktop.
This snippet fails in FF4 Beta 7 while it works in all other browsers
<html>
<head>
<script type="text/javascript" charset="utf-8">
String.prototype.escapeHTML = function() { return this + ""; };
console.log("OK", "<\\n>".toString())
console.log("OK", new String("<\\n>").escapeHTML())
console.log("fails", "<\\n>".escapeHTML())
</script>
</head>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment