I am getting Uncaught SyntaxError: Unexpected token ;
at THE LINE NUMBER
// HTML Helper
var documentHtml = function(html){
Try to change:
.replace(/</(html|head|body|title|meta|script)>/gi,'</div>')
to:
.replace(/<\/(html|head|body|title|meta|script)>/gi,'<\/div>')
You need to escape /
with \
in Javascript
The problem is:
/</(html|head|body|title|meta|script)>/gi
At the time of writing, SO's highlighting shows the problem with the original: the regex seems to be /</
.
It should be:
/<\/(html|head|body|title|meta|script)>/gi
Since Javascript uses forward slashes to delimit regexes, you have to escape any forward slash inside it with a backslash.
IMO, using forward slashes for regexes was the most unfortunate syntax decision of JavaScript:
Parsing JavaScript is difficult because of /
starting multiline comments, single line comments, division, and regexes. (Sublime, my editor choice, gets it wrong. Dreamweaver gets it wrong.)
It makes regexes for URIs/URLs particularly ugly.