Would someone mid explaining what the "TT" bit is in this Javascript
I actually have two simple questions, I hope.
What is the TT used for in this JQuery call below? I cannot find a reference to it anywhere.
TTjquery(window).load(function()
Also, what does the below relate to/mean:
//<![CDATA[ ... //]]>
[Where it is usually wrapped around Javascript]
Thats it really, I just开发者_StackOverflow社区 want to understand what it is before going forward to make sure I am using the correct calls.
Thanks for your help.
The first is probably a jquery plugin and the second is to protect the content of the wrapper from being part of the DOM and have a 8-bit charset. But I'm not very sure.
TT is for TrueThemes: http://support.truethemes.net/home
CDATA explained here: http://en.wikipedia.org/wiki/CDATA
TTjquery
has already been explained, so I'll answer your other question.
<![CDATA[ ... ]]>
, in future referred to as 'the CDATA tag', is a construct in XML and XHTML that includes the contained text as #CDATA where the tag is normally #PCDATA, such as script
, to avoid issues with characters like <
and &
, which are parsed.
In HTML, however, there is no place for the CDATA tag, as not only is script
already a #CDATA tag, there is also no CDATA tag.
The author who used
//<![CDATA[
...
//]]>
most likely does not understand the purpose and usage of the CDATA tag, and is using it incorrectly in an HTML (or, worse, XHTML sent as text/html
) context, where it is completely incorrect and ignored by the HTML parser. The author probably found that he or she needs to comment it out in JavaScript, when in fact, where used properly, it won't need to be at all.
精彩评论