SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Enthusiast
    Join Date
    Sep 2007
    Location
    Kelowna, BC
    Posts
    73
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Script Does Not Run In IE7

    Hey there!

    www.print4print.com

    I have a script that hides a part of the table and a paragraph when the page loads. Clicking the 'show more' link makes the hidden table and paragraph visible.

    Everything seems to work perfectly fine in FF, Chrome, and ie8. I have not tested it in ie6. ie7 does not work for some reason. I can't spot why...

    Any ideas? Thank you very much!

    --
    Victor

  2. #2
    SitePoint Guru
    Join Date
    Sep 2006
    Posts
    731
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What you're calling a link isn't a link, it's a paragraph with an onclick handler, which I.E. (rightly or otherwise) chooses not to call. Even if it were to call it, an error would be generated, since the function expects a parameter that is not being passed.
    Swapping the innerHTML of an element in order to swap a function is a terrible way to do things.
    Use a conventional link that calls a single function that is capable of toggling the display of the table.

    <a href='#' onclick="myFunction();return false">

    Don't use <a href=javascript:....

    You can use DOM methods to toggle the text of the link, which incidentally should be hidden by default and displayed by script.

    No.
    Tab-indentation is a crime against humanity.

  3. #3
    SitePoint Enthusiast
    Join Date
    Sep 2007
    Location
    Kelowna, BC
    Posts
    73
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank you for the suggestion. I've implemented the 'link' suggestion and it seems to work now in ie7. I am not sure why IE chose not to call that function, but I guess it doesn't matter too much now that it works.

    Thank you again!

    Victor


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
  •