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

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • RMWChaos
    New Member
    • Oct 2007
    • 137

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

    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:

    [code=html]
    <img src="../images/myPic.jpg" alt="My Picture" onclick="../scripts/myScript.js" />
    [/code]

    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!
  • drhowarddrfine
    Recognized Expert Expert
    • Sep 2006
    • 7434

    #2
    Are you sure javascript is not turned off in NN?

    Comment

    • RMWChaos
      New Member
      • Oct 2007
      • 137

      #3
      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.

      Comment

      • drhowarddrfine
        Recognized Expert Expert
        • Sep 2006
        • 7434

        #4
        iirc, NN will only display the 'alt' text if the image is actually missing. Try using 'title' instead.

        Comment

        • RMWChaos
          New Member
          • Oct 2007
          • 137

          #5
          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="someJa vaScript.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

          Comment

          • drhowarddrfine
            Recognized Expert Expert
            • Sep 2006
            • 7434

            #6
            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.

            Comment

            • RMWChaos
              New Member
              • Oct 2007
              • 137

              #7
              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!

              Comment

              Working...