Forum Moderators: open

Message Too Old, No Replies

Acheived xhtml validation with flash but...

I'm not sure if i'm cheating?

         

twist

9:31 am on Jan 12, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Couldn't decide whether to post this in html, javascript, or multimedia design. Feel free to move.

I tried the The Satay Method [alistapart.com] but it left a bad taste in my mouth.

So I beat my head into the pavement until I came up with this. I achieve xhtml 1.0 transitional validation but... I'm not sure if it isn't on a technicality. So hopefully some people here might be able to help.

I added this Javascript to my php script.


<script type="text/javascript" language="JavaScript"> <!--
if ( navigator.appName == "Netscape" ) {
var flash = \''. $flash_embed_tags .'\';
}
else {
var flash = \''. $flash_object_tags .'\';
document.write( flash );
}
// -->

My goal was to hide the embed tags unless the browser was Netscape. That way the validation parser couldn't pick them up and declare invalidation. I assumed I would still be invalid in Netscape so I was going to create another bit of Javascript to hide the w3c valid image if the browser was Netscape, just to keep myself honest.

Well, everything worked, it just worked too good. I recieve validation in all browsers, well at least those I tested (ie6,NN7,Moz5,Opera7).

So am I simply cheating the parser, possible bug, by hiding my code in Javascript thus really doing nothing special? Or have I stumbled upon something here?

Should I just be happy that I can now use flash on all my pages and still be technically xhtml 1.0 transitional valid?

P.S. It doesn't work in html 4.01 transitional. It gives me a error on both the embed and object tags. It seems like it wouldn't be able to do that since only one or the other should actually be part of the page.

DrDoc

3:55 pm on Jan 12, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Why did you not like the Satay method?

pageoneresults

4:07 pm on Jan 12, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



twist, you were able to validate with this?

<script type="text/javascript" language="JavaScript">

The script language attribute is deprecated and will usually cause an error when validating. The suggested format is this...

<script type="text/javascript">

twist

6:31 pm on Jan 12, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Why did you not like the Satay method?

Dont get me wrong. I think the guy is really on to something and has done some great work. It just seems like a lot of work creating seperate movies to load movies and i'm not 100% sure that getting rid of some of these tags would be a good idea. Reading through the messages on his site I see a lot of people where having problems with different browsers. The code could possibly break with new browser versions or standards. I just wanted to use the standard code.

twist

6:43 pm on Jan 12, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Oh thank you pageoneresults. Thank you thank thank you.

[whisper]I am new to validation[/whipser]

You fixed it, I can now validate in xhtml 1.1 and xhtml 1.0 strict. I am still getting errors in html 4.01 strict though.

twist

6:46 pm on Jan 12, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



twist, you were able to validate with this?
<script type="text/javascript" language="JavaScript">

Yeah, it was validating in xhtml trans, hmm... bug maybe?