Need Help : Add My Site to Your Bookmark

Discussion in 'JavaScript' started by smilgy, Jun 17, 2007.

  1. #1
    Please, i need this help.
    I want to make a button for bookmarking my site to Browser (To IE or FF).
    I see it in many site which write with JavaScript.
     
    smilgy, Jun 17, 2007 IP
  2. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
  3. krt

    krt Well-Known Member

    Messages:
    829
    Likes Received:
    38
    Best Answers:
    0
    Trophy Points:
    120
    #3
    Did that actually work for you? I remember first doing that and gave up. Ended up searching for how to bookmark for each browser separately and compiled one myself:
    function bookmark(url, title) {
    
        if (window.sidebar)
            window.sidebar.addPanel(title, url, "");
        else if (window.opera && window.print) {
    	  var ele = document.createElement('a');
    	  ele.setAttribute('href', url);
    	  ele.setAttribute('title', title);
    	  ele.setAttribute('rel', 'sidebar');
    	  ele.click();
        } else if (window.external)
            window.external.AddFavorite(url, title);
        else
            alert('Use Ctrl-D, Ctrl-T or Ctrl-B depending on your browser to bookmark this page');
    }
    Code (markup):
    Anyway, I did try googling with a similar query and found:
    http://www.dynamicdrive.com/dynamicindex9/addbook.htm

    Shame that wasn't there when I needed it, and anyway, mine's better :p
     
    krt, Jun 18, 2007 IP