Some examples use the following codes in order to load external JS...
e.g.
document.write("<scr"+"ipt language=javascript ....
I have one qusestion,
Why need to separate the "script" into "<scr"+"ipt ...?
Many people are using this way but i really don't know why...
Because those people lack a minimum clue about what they are doing. Using
the `language' attribute, often instead of the required `type' attribute,
is another indication of that. It is not at all necessary to do the above.
It might have been an attempt at working around the Netscape 4.x Run-Length
Bug (NRLB), but since this is rather a heisenbug, it is not a reliable
approach.
This code is probably based on the common misconception that "</scr" + "ipt"
would prevent a markup parser from accidentally recognizing the end tag of
a dynamically generated `script' element as the end tag of the generating
`script' element, and therefore the start tag of a dynamically generated
`script' element as the start tag of a generating `script' element.
In fact, the latter is unnecessary and the former only works for tag soup
parsers that recognize `</script>' as end of `script' element content. A
standards compliant parser recognizes the ETAGO delimiter (`</') as the
end of the `script' element's CDATA content. Therefore, the reasonable
approach is to write "<\/script>" instead of "</script>" within the HTML
`script' element (that goes for other generated end tags as well). And so
far, there is no known (tag soup) parser that recognizes `<script' within
the `script' element as the start tag of a generating `script' element
before it is generated.
PointedEars