[TYPO3] Troubles getting Javascript validated between <head> tags

R. van Twisk typo3 at rvt.dds.nl
Fri Feb 2 23:35:44 CET 2007


hey Kimmo,

how did you add the javascript?

Ries
> Hi all,
>
> I have a piece of JavaScript that keeps changing in the output code if I try
> to get it validated. I have some code and I've tried tp put <-- with //-->
> and/ or /*<![CDATA[*/ with /*]]>*/. If I don't put these parts in, the code
> won't validate. If I put them, it changes the code into a mess at the end
> like this:
>
> <script type="text/javascript">
> <!--
> function init() {
>   activateMenu('nav3');
>   activateMenu('nav');
> }
> window.onload=init;
> activateMenu = function(nav3) {
>     /* currentStyle restricts the Javascript to IE only */
>     if (document.getElementById(nav3) != null) {
>         if (document.all && document.getElementById(nav3).currentStyle) {
>             var navroot = document.getElementById(nav3);
>             /* Get all the list items within the menu */
>             var lis=navroot.getElementsByTagName("LI");
>             for (i=0; i<lis.length; i="" if="" the="" li="" has=""
> another="" menu="" level="" iflisilastchildtagname="UL" assign=""
> function="" to="" lisionmouseover="function()" display="" inner=""
> thislastchildstyledisplay="none" lisionmouseout="function()" --="">
>
> </script>
>
>
> Any ideas?
>
> Cheers,
> Kimmo Helle
>
>   


-- 
Ries van Twisk
Freelance Typo3 Developer
=== Private:
email: ries at vantwisk.nl
web:   http://www.rvantwisk.nl/freelance-typo3.html
skype: callto://r.vantwisk




More information about the TYPO3-english mailing list