Hello and welcome to our community! Is this your first visit?
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
    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. #2
    Master Coder Dormilich's Avatar
    Join Date
    Jan 2010
    Behind the Wall
    Thanked 568 Times in 561 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. #3
    Senior Coder rnd me's Avatar
    Join Date
    Jun 2007
    Thanked 626 Times in 605 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.
    Create, Share, and Debug HTML pages and snippets with a cool new web app I helped create: pagedemos.com


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