Javascript Q&A

I’m moving the javascript generated by some FW actions into external
files and wanted to know what the function of the // was for and does
it need to be included?

For example:

       //<![CDATA[ createStyleRule("#indexframe","visibility:  

hidden");
window.addEvent(‘load’,function(){window.setTimeout
(‘fadeOnLoad(“indexframe”,2000,Fx.Transitions.linear,1000)’,0);;
window.setTimeout(‘fadeOnLoad(“indexgraphic”,
2000,Fx.Transitions.linear,3800)’,0);;
window.setTimeout(‘fadeOnLoad(“slider”,
1000,Fx.Transitions.linear,6400)’,0);; });
createStyleRule(“#indexgraphic”,“visibility: hidden”);
createStyleRule(“#slider”,“visibility: hidden”);//]]>

Todd


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Hi Todd,
Here’s quite a good article that explains what the CDATA mark is, why it is
commented out and how it functions.

In answer to your question I think the CDATA should go in the HTML page, not the
JS file, and is commented so that non-XHTML browsers simply ignore the line.
Regards,
Tim.

Quoting Todd email@hidden:

I’m moving the javascript generated by some FW actions into external
files and wanted to know what the function of the // was for and does
it need to be included?

For example:

       //<![CDATA[ createStyleRule("#indexframe","visibility:

hidden");
window.addEvent(‘load’,function(){window.setTimeout
(‘fadeOnLoad(“indexframe”,2000,Fx.Transitions.linear,1000)’,0);;
window.setTimeout(‘fadeOnLoad(“indexgraphic”,
2000,Fx.Transitions.linear,3800)’,0);;
window.setTimeout(‘fadeOnLoad(“slider”,
1000,Fx.Transitions.linear,6400)’,0);; });
createStyleRule(“#indexgraphic”,“visibility: hidden”);
createStyleRule(“#slider”,“visibility: hidden”);//]]>

Todd


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


Extend Freeway the way you want with FreewayActions.com
http://www.freewayactions.com


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Thanks Tim, I’ll have a read right now.

Todd

On Mar 14, 2008, at 1:48 PM, email@hidden wrote:

Here’s quite a good article that explains what the CDATA mark is, why it is

commented out and how it functions.

http://javascript.about.com/library/blxhtml.htm