Welcome to WebmasterWorld Guest from 18.104.22.168
Forum Moderators: open
1. why they split the <SCRIPT> tag into '<SCR' and 'IPT>'? I tried to write '<SCRIPT>' and '</SCRIPT>' strings directly, without any problem.
2. They use '\' before /SCR (<\/SCR'+'IPT>');, why?
I have found that it just saves headaches down the road if you do this when using script to write script tags.
Putting this code after '<scr'+'ipt>' actually causes an error, so people who use <script> inside <script>s, split it up so Norton ignores it.
it's just printing a string
Yes, it's just printing a string. But before it 'just' prints the string, Norton amends it.
Then it does not 'just' amend a string, but creates all kinds of errors after it converts it to something like:
... etc ...
As you can see the JS is split over several lines and if Norton inserts a ' or " character, errors occur.
i really don't see how splitting that up would cause problems, after all it's just printing a string.
instead, just add this to any other JS include:
oNode.setAttribute("id", "newScript", 0);
oNode.setAttribute("src", "whatever.js", 0);
setAttribute("id", "newScript", 0);
setAttribute("src", "whatever.js", 0);