[RESOLVED] XHTML strict/IE problems with "id" vs "name"

Ok my webpage (<!-- m --><a class="postlink" href="http://www.andrews.edu/~myhre/comp/learn">http://www.andrews.edu/~myhre/comp/learn</a><!-- m -->) is XHTML strict dtd and I am using a script to change an image in one place if the mouse is over a link in the body text. That script unmodified can be found here: draac.com (<!-- m --><a class="postlink" href="http://www.draac.com/mouseover-text-image.txt">http://www.draac.com/mouseover-text-image.txt</a><!-- m -->). Because my page is XHTML strict it doesn't like the "name" attribute, so I replaced it with "id" (as shown below) and it works...in browsers that are not IE. <img class="lp" src=http://www.webdeveloper.com/forum/archive/index.php/"images/logob.jpg" id="imagename" alt="" /><br />
So my question is what should I do? Should I demote my site to transitional dtd and use the "name" attribute? or should I use the name attribute and not worry about the validation? or should I just say "I'm sorry IE users but get a real browser"? or can I put a conditional statement inside the img tag specifically for IE?<!--content-->Try:<br />
<br />
document.getElementById('imagename')<br />
<br />
in place of<br />
document.imagename.<!--content-->Hmm...well it works in firefox and safari. The real test is if it works in IE. unfortunately I dont have a computer with IE on it handy yet. Myabe I'll test it on IE when my roommate comes back, or someone here could test it and tell me if it works. This is the page it's applied to: website (<!-- m --><a class="postlink" href="http://www.andrews.edu/~myhre/comp/learn">http://www.andrews.edu/~myhre/comp/learn</a><!-- m -->).<!--content-->Ok my webpage is XHTML strict dtdYou are aware that you are serving it as HTML, right?<!--content-->You are aware that you are serving it as HTML, right?<br />
<br />
I really don't know what you mean by that. So no I guess I wouldn't know that.<!--content-->Well what I've read after drhowarddrfine's post if I put the meta tag below on my site it would serve it as xhtml right? Please correct me if I'm wrong.<br />
<br />
<meta http-equiv="content-type" content="application/xhtml" /><!--content-->Well the original problem of the webpage is solved with the code below:<br />
document.getElementById('imagename') <br />
<br />
So it is working as it should. Tested it in IE6 on my roommate computer.<!--content-->Your page is served as what the server tells the browser says it is. Your server is set as "text/html" and most servers are. Setting the <meta> tag or the doctype does not change that. This is a common error that most people aren't aware of. Browsers are not interpreting your markup as xhtml but as a "tag soup" or "broken html". In most cases, this is fine, but you aren't gaining any of the advantages of using xhtml.<br />
<br />
In addition, IE doesn't do xhtml anyway.<!--content-->Hmmm blast IE. Too bad I don't have control of the server I'm using so can't change the setting, oh well. I'll keep that in mind.<!--content-->
 
Top