473,383 Members | 1,868 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,383 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 1559
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

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

Similar topics

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="*"...
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...
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...
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:...
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...
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...
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...
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...
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...
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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$) { } ...
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...
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
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...

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.