tags:

views:

33

answers:

1

Possible Duplicate:
Why split the <script> tag when writing it with document.write()?

I don't really do Javascript programming and was hard to google this but have seen something like this in a couple of different places (by good developers):

document.writeln('<scr'+'ipt src="'+pcheck+'" type="text/javascript"></scr'+'ipt>');

With the split always between the r and the i. What does this achieve?

A: 

This is to prevent any script blockers from loading this script, because they cannot find the "script" word within the text.

Hippo
That may be a side effect but is not the intention. It allows the browser to render a page with script-generated script. It doens't matter where the split is as long as the browser is not given '<script'.
Dan Iveson