hi i just want to ask why it doent work in both of the FF and IE and work in Opera. in FF and IE only the background who appear . the page is this please help thanks
looks like you need to modify the javascript prior to that line.... the <script> prior should be script type="text/javascript" and since you are using XHTML, you will have to encode/escape the javascript for that section. here's an example from W3C <script type="text/javascript"><![CDATA[ document.write("Hello World!") //]]></script> Code (markup): http://www.w3schools.com/TAGS/tag_script.asp after that, you should try change the line you posted to using a closing tag. <script type="text/javascript" src="js/boxOver.js"> </script>
Actually, the problem is simpler than that... Opera will allow you to use self closing on any tag, which is the proper behavior in a XHTML doctype... both FF and IE will not 'self close' the script tag even in a XHTML doctype, partly becuase IE doesn't "really" know what XHTML is, partly becuase FF pays more attention to mime type than declarations in the file itself. As such, script is opened, and never closed by that line. Instead of: <script type="text/javascript" src="js/boxOver.js" /> Use: <script type="text/javascript" src="js/boxOver.js"></script> That's it.
Nice explanation. And, that is proper behavior. The server response header's content type trumps all else. cheers, gary
XHTML 1.0 can be served as either, self closing SHOULD be valid XHTML, so I'm with opera on that one.