473,386 Members | 1,743 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

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

RMWChaos
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" />
  2.  
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

Thanks!
Oct 23 '07 #1
6 1560
drhowarddrfine
7,435 Expert 4TB
Are you sure javascript is not turned off in NN?
Oct 23 '07 #2
RMWChaos
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
drhowarddrfine
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
RMWChaos
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
drhowarddrfine
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
RMWChaos
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

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

Similar topics

15
by: Philipp Lenssen | last post by:
My friend has the following problem (background: we want to transform XML to XHTML via XSLT): "We copy XHTML fragments into an output by using the following template: <xsl:template match="*"...
2
by: David D. | last post by:
If an <IMG> specifies a WIDTH but not a HEIGHT, then height is internally determined so as to maintain the image's aspect ratio. Aspect ratio is also preserved if HEIGHT but not WIDTH is...
8
by: KS | last post by:
Just to show some code to show the consept. <img id="date" onclick="javascript:show_calendar();" src="/PlexSysWeb/images/show-calendar.gif" width=20 height=18 border=0> What i want the...
15
by: Gérard Talbot | last post by:
Hello all, I'd like to know and understand the difference between, say, <img src="/ImageFilename.png" width="123" height="456" alt=""> and <img src="/ImageFilename.png" style="width:...
4
by: Jim Moe | last post by:
Hello, Mozilla (suite and Firefox) ignore the height and width attributes of <img> when the image itself is unavailable (404); only enough space is allocated for the alt text. Is this expected...
3
by: Henry Johnson | last post by:
Okay - I'm spinning my wheels on this one... can someone help me figure out how to programmatically populate a table cell as follows (from C# code-behind)? I've tried using a Literal control in the...
10
by: News | last post by:
I am trying to be able to manipulate the width and height of an <img> but do not seem to be able. "Yes", I know the JavaScript will "not" manip anything, which is ok. I simply do not know how to...
4
by: SammyBar | last post by:
Hi all, I wonder is it possible to upload the content of an <imgfield to a server. The content of the <imgwas downloaded from a web site different from the one it should be uploaded. The image...
17
by: biju | last post by:
It is very common to see an image as a link on many web pages. Authors create them by putting an <imgtag inside a <atag. This is very much extra use of another tag. But why browsers dont support...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.