View Full Version : Validator problems

01-16-2009, 03:12 PM
I just inserted a flash music player SWFObject w/ javascript and I got some new errors in the W3 validator. Don't pay any attention to any errors before line 40 they are all after it. It seems to be a problem with the tags.. Is my SWFObject up to date? How can I fix these errors? Here's the validator page for my website. (http://validator.w3.org/check?uri=http%3A%2F%2Fwww.*******************&charset=%28detect+automatically%29&doctype=Inline&group=0) Thanks so much!

01-16-2009, 10:56 PM
Please? Any help with this?

01-18-2009, 04:48 AM
This forum use to be so helpful :(

01-18-2009, 05:57 AM
You might find these list useful:

You are serving your page as HTML, and not XHTML. So no need for the self-close of tags:
Line 36:

<img src="http://members.tripod.com/adm/img/common/ot_noscript.gif?rand=887748" alt="" width="1" height="1" />

...remove highlighted.

Change & into: &amp;:

<iframe frameborder="0" marginwidth="0" marginheight="0" scrolling="no" width="728" height="90" src="http://ad.yieldmanager.com/st?ad_type=iframe&ad_size=728x90&section=209094"></iframe>

Your CDATA island is erroneous.
This part:

// <![CDATA[
// ]]>

...should be:

/* <![CDATA[ */
/* ]]> */

...but there's no need to surround your JS with CDATA islands since you're just serving your page as HTML.

It's better to make this script:

<script type="text/javascript">
var so = new SWFObject("ep_player.swf", "ep_player1", "269", "25", "9", "#FFFFFF");
so.addVariable("skin", "skin.xml");
so.addVariable("file", "<location>http://boxstr.com/files/4635076_hklnx/America%20%28w%20Hook%29.mp3</location><creator>DurkMusic Productions</creator><title>Title of Song</title>)";
so.addVariable("autoplay", "false");
so.addVariable("shuffle", "false");
so.addVariable("buffertime", "1");


...an external script - will save you validation flaws.

...and lastly, have a read on deprecated tags and attributes (http://www.codehelp.co.uk/html/deprecated.html).

Hope that keeps you going.

01-18-2009, 03:40 PM
Thanks but taking out the CDATA didn't work :(

and don't forget... I can't change anything from line 40 up so just ignore those errors...

01-19-2009, 07:32 AM
Hey rangana, can you explain your #3? I've always used the "erroneous" method to comment out CDATA islands for JS - I wouldn't mind knowing why that's incorrect.