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 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Apr 2010
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Dynamic HTML text

    I have a webpage with a link on it to an HTML file, but I want the user to be able to download the HTML file instead of open it by right-clicking the link and selecting Save Target As... (IE) or Save Link As... (Firefox). The page has instructions for downloading the file, but I want the context-menu item label (Save Target As... or Save Link As...) to dynamically change depending on the user's browser.

    What is the best way using JavaScript and HTML to do this?

    Maybe a placeholder tag in the HTML? If so, which tag?

  • #2
    Senior Coder Dormilich's Avatar
    Join Date
    Jan 2010
    Location
    Behind the Wall
    Posts
    3,474
    Thanks
    13
    Thanked 361 Times in 357 Posts
    the download and context menu has nothing to do with HTML because that’s either server side or application internal. and I don’t like someone playing with my context menu.
    The computer is always right. The computer is always right. The computer is always right. Take it from someone who has programmed for over ten years: not once has the computational mechanism of the machine malfunctioned.
    André Behrens, NY Times Software Developer

  • #3
    Senior Coder rnd me's Avatar
    Join Date
    Jun 2007
    Location
    Urbana
    Posts
    4,461
    Thanks
    11
    Thanked 600 Times in 580 Posts
    you can try to recreate an entire context menu for every browser (not reccommended or actually possible), but you can't modify a user's normal menu without coding your app as an extension.
    my site (updated 2014/10/20)
    BROWSER STATS [% share] (2014/9/03) IE7:0.1, IE8:4.3, IE11:9.2, IE9:2.7, IE10:2.6, FF:16.8, CH:47.5, SF:7.8, NON-MOUSE:37%


  •  

    Tags for this Thread

    Posting Permissions

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