krux / postscribe

Asynchronously write javascript, even with document.write.
MIT License
986 stars 157 forks source link

Uncaught SyntaxError: Invalid or unexpected token #454

Closed tomgallagher closed 7 years ago

tomgallagher commented 7 years ago

Hi, me again

This inline script code string is causing an invalid or unexpected token error :

"/*<![CDATA[*/ (function(){ if (typeof orb !== 'undefined' && typeof orb.fig === 'function') { if (orb.fig('ad') && orb.fig('uk') == 0) { bbcdotcom.data = { ads: (orb.fig('ad') ? 1 : 0), stats: (orb.fig('uk') == 0 ? 1 : 0), statsProvider: orb.fig('ap') }; } } else { document.write('<script type=\"text/javascript\" src=\"'+('https:' == document.location.protocol ? 'https://www.bbc.com' : 'http://tps.bbc.com')+'/wwscripts/data\"></script>'); } })(); /*]]>*/"

Any ideas?

Tom

gauravsafetynet commented 4 years ago

inline script code gives unexpected token error