Richard wrote:
Yanick wrote:
http://www.w3schools.com/jsref/jsref_onload.asp
has your information. Don't you love W3Schools ? :)
Yes; partial information and falsehoods put across as if it was
definitive.
<snip>
>3) employ this to wrap your JS inside the <imgevent attribute :
<img src="blah.gif" onload="//<![CDATA[
/** some js code here **/
//]]>" />
When you have absolutely no idea why you are recommending something it
would probably be better not to mention it at all. This is a mystical
incantation, and can achieve nothing.
Using CDATA is not a 'mystical incantation' when used as required by
the XML application to set aside parsing the CDATA content.
>
>Read about it here : http://en.wikipedia.org/wiki/CDATA
<snip>
A page that never suggests the above nonsense, or even implies anything
about it.
Well. it does mention
'The term indicates that a certain portion of the document
is general character data, rather than non-character data or character
data with a more specific, limited structure.'
In some XML applications, the idea of 'general character data' is exploited
to hide an inline script from the operations that deal with figuring out the
rest of the XML user code.
For example:
....
<Script DEF='OpenVault'>
....
<![CDATA[ ecmascript:
function combinationEntered (value) {
unlocked = value;
}
function openVault(value) {
if (unlocked) vaultUnlocked = value;
}
]]>
</Script>
http://www.web3d.org/x3d/specificati...riptingExample
This is the special case of a Script node in a specific XML application that
also generally applies to inline script handling in XHTML tools.
>
Richard.
Fortunately, in that application, like others, there is a way to get rid of
the
CDATA or equivalent wrapper. Instead, just include the url to the script
location.
Thanks and Best Regards,
Joe