Results 1 to 2 of 2

Thread: W3C Validation of script

  1. #1
    Join Date
    Sep 2010
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default W3C Validation of script

    I have a small issue, recently purchased this flash image rotator which is working superb and just the job except it will not validate.

    Now this is the first flash element i have used within a site i am trying to keep W3C compliant to XHTML transitional 1.0 level.

    Original Code on the HTML page:

    Code:
    <div id="main_rotator">
    
    <script language="javascript" type="text/javascript">
    	if (AC_FL_RunContent == 0) {
    		alert("This page requires AC_RunActiveContent.js.");
    	} else {
    		AC_FL_RunContent(
    			'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0',
    			'width', '100%',
    			'height', '100%',
    			'src', 'rotator',
    			'quality', 'high',
    			'pluginspage', 'http://www.macromedia.com/go/getflashplayer',
    			'align', 'middle',
    			'play', 'true',
    			'loop', 'true',
    			'scale', 'showall',
    			'wmode', 'transparent',
    			'devicefont', 'false',
    			'id', 'rotator',
    			'bgcolor', '#F1F2F2',
    			'name', 'rotator',
    			'menu', 'true',
    			'allowFullScreen', 'false',
    			'allowScriptAccess','sameDomain',
    			'movie', 'rotator',
    			'salign', ''
    			); //end AC code
    	}
    </script>
    <noscript>
    	<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="100%" height="100%" id="rotator" align="middle">
    	<param name="allowScriptAccess" value="sameDomain" />
        <param name="wmode" value="transparent" />
    	<param name="allowFullScreen" value="false" />
    	<param name="movie" value="rotator.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#F1F2F2" />	<embed src="rotator.swf" quality="high" bgcolor="#F1F2F2" width="100%" height="100%" name="rotator" align="middle" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
    	</object>
    </noscript>
    
    </div><!-- end of "main_rotator" -->

    Validation errors:

    # Error Line 301, Column 133: there is no attribute "src"

    …gcolor" value="#F1F2F2" /> <embed src="rotator.swf" quality="high" bgcolor="#F…



    # Error Line 301, Column 155: there is no attribute "quality"

    …" /> <embed src="rotator.swf" quality="high" bgcolor="#F1F2F2" width="100%" he…



    # Error Line 301, Column 170: there is no attribute "bgcolor"

    …="rotator.swf" quality="high" bgcolor="#F1F2F2" width="100%" height="100%" nam…



    # Error Line 301, Column 186: there is no attribute "width"

    …uality="high" bgcolor="#F1F2F2" width="100%" height="100%" name="rotator" alig…



    # Error Line 301, Column 200: there is no attribute "height"

    …bgcolor="#F1F2F2" width="100%" height="100%" name="rotator" align="middle" all…



    # Error Line 301, Column 212: there is no attribute "name"

    …F2F2" width="100%" height="100%" name="rotator" align="middle" allowScriptAcce…



    # Error Line 301, Column 228: there is no attribute "align"

    …%" height="100%" name="rotator" align="middle" allowScriptAccess="sameDomain" …



    # Error Line 301, Column 255: there is no attribute "allowScriptAccess"

    …tor" align="middle" allowScriptAccess="sameDomain" allowFullScreen="false" typ…



    # Error Line 301, Column 284: there is no attribute "allowFullScreen"

    …ptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-fl…



    # Error Line 301, Column 297: there is no attribute "type"

    …eDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginsp…



    # Error Line 301, Column 341: there is no attribute "pluginspage"

    …cation/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashpl…



    # Error Line 301, Column 388: element "embed" undefined

    …x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    29,030
    Thanks
    44
    Thanked 3,211 Times in 3,173 Posts
    Blog Entries
    12

    Default

    You have three basic choices:

    1. Live with it. The embed tag has been deprecated for some time now. But all major browsers that can use it do so anyway. The javascript probably writes out an embed tag for them. But the validator cannot see that.

    2. Dispense with the <noscript> tag content, replace it with:

      Code:
      <noscript>Javascript is required to view this Flash content.</noscript>
      or something like that which will lay out well in the space it will occupy when javascript is disabled.

    3. Use a valid single object tag or valid nested object tag combo to replave the invalid object/embed combo.


    Bear in mind that the version of AC_FL_RunContent() used with this probably writes an invalid embed tag for those browsers that can use it anyway. If not, you could simply view the generated source code (if you have a utility that will do that) in one of those browsers (like Firefox, or anything not IE), copy and use that in the <noscript> section.

    Obviously number 1 or 2 are easiest. It's not too hard to come up with a single valid object tag either. But if your Flash feature needs to stream, it will be inefficient in some IE versions, bear in mind this is only an issue in IE (less than 7 or less than 8, not sure which) when javascript is disabled:

    Code:
    <noscript>
    	<object data="rotator.swf" type="application/x-shockwave-flash" width="100%" height="100%" id="rotator" align="middle">
    	<param name="allowScriptAccess" value="sameDomain" />
    	<param name="wmode" value="transparent" />
    	<param name="allowFullScreen" value="false" />
    	<param name="movie" value="rotator.swf" />
    	<param name="quality" value="high" />
    	<param name="bgcolor" value="#f1f2f2" />
    	</object>
    </noscript>
    If you want more help:

    Please post a link to a page on your site that contains the problematic code so we can check it out.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

Bookmarks

Posting Permissions

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