• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter Twelve. Working with Browsers Pa... > Cheating with JavaScript document.wr...

Cheating with JavaScript document.write

In an effort to embed Flash content and still achieve XHTML validation, some designers have used JavaScript browser detection and document.write to sneak the invalid <embed> tags past the W3C validation testing service:

<!-- used to create valid xhtml with embed tag -->
<script type="text/javascript">
//<![CDATA[
if (navigator.mimeTypes && navigator.mimeTypes["application/ x-shockwave-flash"]){
document.write('<embed src="/media/yourflashmovie.swf" ...


					  


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint