Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    Regular Coder
    Join Date
    Nov 2009
    Posts
    202
    Thanks
    25
    Thanked 0 Times in 0 Posts

    updated title: <![CDATA tags blocking javascript possible?

    not sure how to correct this issue with the height. What is the solution?


    Attribute "height" exists, but can not be used for this element.
    "ns4div1" width="'+swidth+'" height="'+sheight+'" onmouseover="sspeed=0;" onm

    You have used the attribute named above in your document, but the document type you are using does not support that attribute for this element. This error is often caused by incorrect use of the "Strict" document type with a document that uses frames (e.g. you must use the "Transitional" document type to get the "target" attribute), or by using vendor proprietary extensions such as "marginheight" (this is usually fixed by using CSS to achieve the desired effect instead).

    This error may also result if the element itself is not supported in the document type you are using, as an undefined element will have no supported attributes; in this case, see the element-undefined error message for further information.

    How to fix: check the spelling and case of the element and attribute, (Remember XHTML is all lower-case) and/or check that they are both allowed in the chosen document type, and/or use CSS instead of this attribute. If you received this error when using the <embed> element to incorporate flash media in a Web page, see the FAQ item on valid flash.

    Code:
      <div style="width: 225px; float: left; height: 16px; background-color: #000000; color: #FFFFFF; margin-left: 0px; margin-bottom: 0px; font-size: small; padding-left: 0px;">
    	&nbsp;<img src="images/news.png" height="16" width="222" /><div style="width: 226px; height: 155px; float: left;"><script type="text/javascript">if(document.layers){document.write('<ilayer id="ns4div" width="'+swidth+'" height="'+sheight+'" bgcolor='+sbcolor+'><layer id="ns4div1" width="'+swidth+'" height="'+sheight+'" onmouseover="sspeed=0;" onmouseout="sspeed=rspeed"></layer></ilayer>')}
    if(document.getElementById||document.all){document.write('<div style="position:relative;overflow:hidden;width:'+swidth+'px;height:'+sheight+'px;clip:rect(0 '+swidth+'px '+sheight+'px 0);background-color:'+sbcolor+';" onmouseover="sspeed=0" onmouseout="sspeed=rspeed"><div id="iens6div" style="position:relative;width:'+swidth+'px;"></div></div>');}</script>
    </div></div>
    Last edited by cyborg360; 01-01-2010 at 03:15 AM.

  • #2
    Master Coder
    Join Date
    Dec 2007
    Posts
    6,682
    Thanks
    436
    Thanked 890 Times in 879 Posts
    Quote Originally Posted by cyborg360 View Post
    not sure how to correct this issue with the height. What is the solution?

    Code:
      <div style="width: 225px; float: left; height: 16px; background-color: #000000; color: #FFFFFF; margin-left: 0px; margin-bottom: 0px; font-size: small; padding-left: 0px;">
    	&nbsp;<img src="images/news.png" height="16" width="222" /><div style="width: 226px; height: 155px; float: left;"><script type="text/javascript">if(document.layers){document.write('<ilayer id="ns4div" width="'+swidth+'" height="'+sheight+'" bgcolor='+sbcolor+'><layer id="ns4div1" width="'+swidth+'" height="'+sheight+'" onmouseover="sspeed=0;" onmouseout="sspeed=rspeed"></layer></ilayer>')}
    if(document.getElementById||document.all){document.write('<div style="position:relative;overflow:hidden;width:'+swidth+'px;height:'+sheight+'px;clip:rect(0 '+swidth+'px '+sheight+'px 0);background-color:'+sbcolor+';" onmouseover="sspeed=0" onmouseout="sspeed=rspeed"><div id="iens6div" style="position:relative;width:'+swidth+'px;"></div></div>');}</script>
    </div></div>
    comments, for xhtml:
    Code:
    <script type="text/javascript">// <![CDATA[
    ....
    // ]]></script>
    best regards

  • #3
    Regular Coder
    Join Date
    Nov 2009
    Posts
    202
    Thanks
    25
    Thanked 0 Times in 0 Posts

    Thumbs up

    Quote Originally Posted by oesxyl View Post
    comments, for xhtml:
    Code:
    <script type="text/javascript">// <![CDATA[
    ....
    // ]]></script>
    best regards
    cool that took care of 12 errors.

    but now my news ticker isnt working...maybe if I fix something else it will...I hope I can still use the thing with completely validated code.

    If I validate more is it likely the javascript running the news ticker will work if adding <![CDATA... stopped it from working?
    Last edited by cyborg360; 01-01-2010 at 03:13 AM.

  • #4
    Master Coder
    Join Date
    Dec 2007
    Posts
    6,682
    Thanks
    436
    Thanked 890 Times in 879 Posts
    Quote Originally Posted by cyborg360 View Post
    cool that took care of 12 errors.

    but now my news ticker isnt working...maybe if I fix something else it will...I hope I can still use the thing with completely validated code.
    this:
    Code:
    <div style="width: 226px; height: 155px; float: left;">![CDATA[<script type="text/javascript">
    Code:
    </div>');}]]></script>
    must be:
    Code:
    <div style="width: 226px; height: 155px; float: left;"><script type="text/javascript">// <![CDATA[
    Code:
    </div>');}// ]]></script>
    javascript comments // <![CDATA[ or /* <![CDATA[ */ after <script type..
    and // ]]> or /* ]]> */ before </script>

    best regards

  • Users who have thanked oesxyl for this post:

    cyborg360 (01-01-2010)


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •