471,605 Members | 1,520 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,605 software developers and data experts.

<img> attributes work in FF and IE, but not NN?

137 100+
WinVista/WinXP IE7/FF2.0.0.8/NN9

Help, I'm new to web coding and more familiar with IE than anything else. In my webpage, I have the code:

Expand|Select|Wrap|Line Numbers
  1. <img src="../images/myPic.jpg" alt="My Picture" onclick="../scripts/myScript.js" />
This code seems to work perfectly in IE7 and FF2.0.0.8, but NN9 just sits there looking, well, stupid. Only the src attrib seems to work, but no alt message on hover and no script on click.

What am I doing wrong that does not take into account NN's "special" needs? Is this actually due to my NN browser settings and not the code? I'm sure I'll be the one sitting here looking stupid when I hear the answer. =D

Oct 23 '07 #1
6 1526
7,435 Expert 4TB
Are you sure javascript is not turned off in NN?
Oct 23 '07 #2
137 100+
Confirmed that "Enable Javascript" is checked, but I would not expect that to affect the alt text anyway, which is an HTML standard, not JS.

My Javascripts are also not running, however; so I suspect it might have to do with the fact that I installed SUN JRE before I installed NN. Still, I installed it before installing FF too, but all works okay there.
Oct 23 '07 #3
7,435 Expert 4TB
iirc, NN will only display the 'alt' text if the image is actually missing. Try using 'title' instead.
Oct 23 '07 #4
137 100+
Thanks, I will try that. I suppose using alt="" and title="" at the same time should not cause a problem. If one browser does not use it, it will ignore it I hope.

Now what about onclick="someJavaScript.js"? Any ideas why that won't fire in NN? Does it have a different attribute than IE and FF as well?

Darnit, why can't all these browsers get their acts together and get standardized!? =D
Oct 23 '07 #5
7,435 Expert 4TB
The only browser that has problems with standardization is IE. If you write to the standard, you should have no problems in most cases.

Been gone all day. Need time to recoup.
Oct 23 '07 #6
137 100+
Yes, that was my little joke. IE is a pain in the arse.

Well, I did a little test with onclick="alert('message')" and it worked just fine; so this is obviously a script issue, not an html issue. So off to the Javascript forums I go.

Strange that it works in FF2.0.0.8 but not NN9 considering both are Mozilla 2 based browsers.

Thanks for your help!
Oct 23 '07 #7

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

15 posts views Thread by Philipp Lenssen | last post: by
10 posts views Thread by News | last post: by
reply views Thread by leo001 | last post: by
reply views Thread by CCCYYYY | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.