Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6

Thread: Firefox problem

  1. #1
    JKF
    JKF is offline
    New to the CF scene
    Join Date
    Sep 2008
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Firefox problem

    Hi everyone, hopefully you can help me with this annoying Firefox problem. I have the code below working fine in IE, yet in FF it won't do anything... Why?


    <script type="text/javascript">
    function Show_Stuff(Click_Menu)
    {
    if (Click_Menu.style.display == "none")
    {
    Click_Menu.style.display = "";
    }
    else
    {
    Click_Menu.style.display = "none";
    }
    }
    </script>

    <a href="javascript:Show_Stuff(display2)">click me</a>

    <span ID="display2" style="display: none">
    hello....</span>

  • #2
    Senior Coder rangana's Avatar
    Join Date
    Feb 2008
    Location
    Cebu City, Philippines
    Posts
    1,752
    Thanks
    65
    Thanked 372 Times in 365 Posts
    It's showing at my end, both on IE and FF. Verify your settings. It may have JS disabled.
    Learn how to javascript at 02geek

    The more you learn, the more you'll realize there's much more to learn
    Ray.ph

  • #3
    JKF
    JKF is offline
    New to the CF scene
    Join Date
    Sep 2008
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I've just checked and javascript is enabled in FF...

    So when you try this, you click the link and the extra text appears, in FF?

  • #4
    Senior Coder rangana's Avatar
    Join Date
    Feb 2008
    Location
    Cebu City, Philippines
    Posts
    1,752
    Thanks
    65
    Thanked 372 Times in 365 Posts
    Yes. "hello...." shows right beside click me link.
    Learn how to javascript at 02geek

    The more you learn, the more you'll realize there's much more to learn
    Ray.ph

  • #5
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,860
    Thanks
    160
    Thanked 2,223 Times in 2,210 Posts
    Blog Entries
    1
    Change it like
    Code:
    <a href="#" onclick="Show_Stuff('display2'); return false;">click me</a>
    Code:
    <script type="text/javascript">
    function Show_Stuff(Click_Menu)
    {
    var elm=document.getElementById(Click_Menu);
    if (elm.style.display == "none")
    {
    elm.style.display = "";
    }
    else
    {
    elm.style.display = "none";
    }
    }
    </script>
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • #6
    JKF
    JKF is offline
    New to the CF scene
    Join Date
    Sep 2008
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks abduraooft, top man!


  •  

    Posting Permissions

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