SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Jun 2006
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Disable button display in Mozilla Firefox

    I am working on a website and have a button on that page as a bookmark. However, when I go to Mozilla Firefox, it displays the same button to mark as a bookmark. Is there a way to disable the button in Mozilla Firefox to only show up in Internet Explorer at this point using Javascript?

  2. #2
    SitePoint Enthusiast TriLLi's Avatar
    Join Date
    Feb 2010
    Location
    BiH, Bugojno
    Posts
    86
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi, you can do it like this

    if(navigator.appName == 'Netscape')
    {
    // code for hiding button
    }
    http://www.wiseblog.info
    Programmers don't die, they just GO SUB without return.

  3. #3
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,678
    Mentioned
    99 Post(s)
    Tagged
    4 Thread(s)
    Please do not use browser-sniffing techniques. They died out with the dinosaurs because there are much more appropriate techniques to use these days.

    Sniffing for Netscape doesn't prevent the same problem from occurring on the hundreds of other types of web browsers that are out there.

    A more appropriate solution is to use an Internet Explorer specific technique called conditional comments, which causes no problems on all other web browsers.

    Code:
    <!--[if IE]>
    <script type="text/javascript" src="bookmark.js"></script>
    <![endif]-->
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript


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
  •