Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

JavaScript Forum


You are currently viewing our JavaScript Forum as a guest. Please register to participate.
Login



Reply
Does //<![CDATA[ improve load time?
Old 08-04-2009, 10:56 PM Does //<![CDATA[ improve load time?
TWD
TWD's Avatar
King Spam Talker

Posts: 1,112
Trades: 0
If I wrap my inline JavaScript with

//<![CDATA[

Some JavaScript in here...

//]]>

Does that speed up the browser parsing and therefore page load time?
TWD is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 08-05-2009, 02:42 PM Re: Does //<![CDATA[ improve load time?
wayfarer07's Avatar
Poo on You

Latest Blog Post:
Introducing WowWindow
Posts: 3,985
Name: Abel Mohler
Location: Asheville, North Carolina USA
Trades: 0
It shouldn't. CDATA is just an XML wrapper to represent Character Data, so that the validation will allow characters such as < and > within that block. So it is only relevant if you use an XHTML doctype.
__________________
Join me on
Please login or register to view this content. Registration is FREE
wayfarer07 is offline
Reply With Quote
View Public Profile Visit wayfarer07's homepage!
 
Old 08-05-2009, 08:58 PM Re: Does //<![CDATA[ improve load time?
TWD
TWD's Avatar
King Spam Talker

Posts: 1,112
Trades: 0
Quote:
Originally Posted by wayfarer07 View Post
It shouldn't. CDATA is just an XML wrapper to represent Character Data, so that the validation will allow characters such as < and > within that block. So it is only relevant if you use an XHTML doctype.

I sometimes use it to wrap inline JavaScript so
that may page passes W3C validation.
Just wondered if there were any other benefits.

thanks.
TWD is offline
Reply With Quote
View Public Profile
 
Old 08-05-2009, 09:38 PM Re: Does //<![CDATA[ improve load time?
wayfarer07's Avatar
Poo on You

Latest Blog Post:
Introducing WowWindow
Posts: 3,985
Name: Abel Mohler
Location: Asheville, North Carolina USA
Trades: 0
Right... I do the same thing, but I can't see that it would have a performance benefit since browsers will just ignore it (it's hidden with JS single line comment characters //).
__________________
Join me on
Please login or register to view this content. Registration is FREE
wayfarer07 is offline
Reply With Quote
View Public Profile Visit wayfarer07's homepage!
 
Old 08-06-2009, 12:50 AM Re: Does //<![CDATA[ improve load time?
The-Pixel's Avatar
I <3 Pixel's

Posts: 888
Name: Lindi Wheaton
Location: In Photoshop
Trades: 0
Quote:
Originally Posted by TWD View Post
I sometimes use it to wrap inline JavaScript so
that may page passes W3C validation.
Just wondered if there were any other benefits.

thanks.
I do that also when need be.
__________________
The-Pixel

Please login or register to view this content. Registration is FREE
:: iPhone Apps, Pre-Made Templates, Widgets, Menus, etc.

Please login or register to view this content. Registration is FREE
:: Web Design / Development, Business Cards, Logo Designs, etc.
The-Pixel is offline
Reply With Quote
View Public Profile Visit The-Pixel's homepage!
 
Reply     « Reply to Does //<![CDATA[ improve load time?
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.15535 seconds with 12 queries