SitePoint Sponsor

User Tag List

Results 1 to 9 of 9
  1. #1
    SitePoint Guru davedibiase's Avatar
    Join Date
    Aug 2001
    Location
    Toronto, Canada
    Posts
    829
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    javascript function wont fire

    hi there,

    I'm having some trouble that's driving me a little bonkers. I'm not GREAT at JS so this might be something super simple.

    I'm trying to get my site to work on multiple browsers but the JS is being a particular pain.

    http://dev.vfxy.com/

    In Firefox and IE7 all my JS seems to work properly but when load it in IE6 there are HUGE issues. I can't seem to trigger functions from HTML onClicks. I've added alerts to determine that the JS file is loading properly, thus the "yoddly" you see when the site first loads - hehe.

    I can fire the requests in every other browser BUT IE what's going on?

    *cries*

    Thanks in advance!
    ||Dave Di Biase||
    ----------------------------------
    "There are 2 secrets in life. 1) Never say everything you know."
    GFXWARS - The ultimate graphics battle!

  2. #2
    CTO htmlguy's Avatar
    Join Date
    Feb 2005
    Location
    North Carolina
    Posts
    420
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hmmm.... I thought that onClick was a perfectfully useful function in IE, are you using js functions or just commands inline?
    HTMLGuy

  3. #3
    SitePoint Guru davedibiase's Avatar
    Join Date
    Aug 2001
    Location
    Toronto, Canada
    Posts
    829
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm calling a function. Try clicking the + below the country flag. In Firefox it works but in IE nada. It doesn't even report any errors!!!

    The function being called is toggleOpt in http://dev.vfxy.com/js/box_control.js

    Once the function is fired it should alert with "hi" then perform the rest of the functions. It's just not doing anything on my end - it's not firing nor is it reporting errors.

    So confused.
    ||Dave Di Biase||
    ----------------------------------
    "There are 2 secrets in life. 1) Never say everything you know."
    GFXWARS - The ultimate graphics battle!

  4. #4
    SitePoint Addict ALL's Avatar
    Join Date
    Oct 2005
    Location
    South Dakota
    Posts
    215
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    first off it is not "onClick" it's "onclick". secondly... i tested it in IE6 and it works fine. Make sure that it isnt caching it.
    Did I help you?
    You can repay me, support one of my projects (no money needed):
    JavaScript Wiki, Another Web Forum, Paranormal Site

  5. #5
    SitePoint Guru davedibiase's Avatar
    Join Date
    Aug 2001
    Location
    Toronto, Canada
    Posts
    829
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    erm it shouldn't make a difference. onclick or onClick. I've changed it either way. nothing is being cached it still doesn't work on my system or any system in my home NOR my visitors (who are complaining).
    ||Dave Di Biase||
    ----------------------------------
    "There are 2 secrets in life. 1) Never say everything you know."
    GFXWARS - The ultimate graphics battle!

  6. #6
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,608
    Mentioned
    24 Post(s)
    Tagged
    1 Thread(s)
    Javascript is case sensitive so onclick and onClick are completely different in the same way that people who come from Poland shouldn't be used as something to shine your shoes with.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  7. #7
    SitePoint Guru davedibiase's Avatar
    Join Date
    Aug 2001
    Location
    Toronto, Canada
    Posts
    829
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I guess so, but I mean in the HTML itself if I use onClick or onclick it doesn't seem to matter.

    I'm still having trouble guys. what am I doing wrong *cries harer*
    ||Dave Di Biase||
    ----------------------------------
    "There are 2 secrets in life. 1) Never say everything you know."
    GFXWARS - The ultimate graphics battle!

  8. #8
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,608
    Mentioned
    24 Post(s)
    Tagged
    1 Thread(s)
    HTML is not case sensitive for most things so there onclick and onClick are the same provided that it is used within the HTML itself and is not within <script> tags.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  9. #9
    SitePoint Guru
    Join Date
    Sep 2006
    Posts
    731
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by davedibiase View Post
    hi there,

    I'm having some trouble that's driving me a little bonkers. I'm not GREAT at JS so this might be something super simple.

    I'm trying to get my site to work on multiple browsers but the JS is being a particular pain.

    http://dev.vfxy.com/

    In Firefox and IE7 all my JS seems to work properly but when load it in IE6 there are HUGE issues. I can't seem to trigger functions from HTML onClicks. I've added alerts to determine that the JS file is loading properly, thus the "yoddly" you see when the site first loads - hehe.

    I can fire the requests in every other browser BUT IE what's going on?

    *cries*

    Thanks in advance!
    The problem is caused by the routine in pngfix.js, which fails to preserve any onclick handler associated with the image.

    Rewrite the function or change to a gif etc.
    Tab-indentation is a crime against humanity.


Bookmarks

Posting Permissions

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