Results 1 to 4 of 4

Thread: JS Works in IE and Opera but not FF, why?

  1. #1

    Thread Starter
    Frenzied Member Fishcake's Avatar
    Join Date
    Feb 2001
    Location
    Derby, UK
    Posts
    1,092

    JS Works in IE and Opera but not FF, why?

    The following HTML shows an image which when clicked on just changes the src to another image which when it is clicked on goes back to the original.

    Everything works ok in Opera 8 and IE6 but in Firefox the image doesn't change, does anyone know why?

    PHP Code:
    <a href="" onclick="hidMap.value = 3 - parseInt(hidMap.value); imgMap.src='/img/map/map_otus_' + hidMap.value + '.gif'; return false">
    <
    img id="imgMap" name="imgMap" alt="Map" src="/img/map/map_otus_1.gif" border="0px"></a

  2. #2
    Frenzied Member sciguyryan's Avatar
    Join Date
    Sep 2003
    Location
    Wales
    Posts
    1,763

    Re: JS Works in IE and Opera but not FF, why?

    Quote Originally Posted by Fishcake
    The following HTML shows an image which when clicked on just changes the src to another image which when it is clicked on goes back to the original.

    Everything works ok in Opera 8 and IE6 but in Firefox the image doesn't change, does anyone know why?

    PHP Code:
    <a href="" onclick="hidMap.value = 3 - parseInt(hidMap.value); imgMap.src='/img/map/map_otus_' + hidMap.value + '.gif'; return false">
    <
    img id="imgMap" name="imgMap" alt="Map" src="/img/map/map_otus_1.gif" border="0px"></a
    Put it inside a function and then run the function from the onlcick event and see if that fixes it. Firefox can sometimes be picky about having lots of code in the event handlers :-)

    Cheers,

    Ryan Jones
    My Blog.

    Ryan Jones.

  3. #3

    Thread Starter
    Frenzied Member Fishcake's Avatar
    Join Date
    Feb 2001
    Location
    Derby, UK
    Posts
    1,092

    Re: JS Works in IE and Opera but not FF, why?

    Thanks, I'll give that a try.......tsk FireFox never works as it should!

  4. #4
    Frenzied Member sciguyryan's Avatar
    Join Date
    Sep 2003
    Location
    Wales
    Posts
    1,763

    Re: JS Works in IE and Opera but not FF, why?

    Quote Originally Posted by Fishcake
    Thanks, I'll give that a try.......tsk FireFox never works as it should!

    Fx has the idea correct, the whole point of the event halders is to haldle functions not lines of code - thats whyfunctions were made in the first place

    Cheers,

    Ryan Jones
    My Blog.

    Ryan Jones.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width