Welcome to TalkGraphics.com
Results 1 to 6 of 6
  1. #1
    Join Date
    Apr 2010
    Location
    NZ
    Posts
    27

    Default Adding a "Bookmark This Page" link

    Hi All

    Is it possible to create a link that automatically adds the current web page to the user's browser bookmarks when clicked?

    Thanks.

  2. #2
    Join Date
    Aug 2010
    Posts
    533

    Default Re: Adding a "Bookmark This Page" link

    Paste this code into a placeholder and position it where you want the link to appear.

    Code:
    <SCRIPT LANGUAGE="JavaScript"><SCRIPT LANGUAGE="JavaScript">
    <!-- Begin
    if ((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion) >= 4)) {
    
    var url=document.URL;
    var title="YOUR WEBSITE TITLE HERE";
    
    document.write('<A HREF="javascript:window.ext');
    document.write('ernal.AddFavorite(url,title);" ');
    document.write('onMouseOver=" window.status=');
    document.write("'Bookmark this page!'; return true ");
    document.write('"onMouseOut=" window.status=');
    document.write("' '; return true ");
    document.write('">Bookmark this page!</a>');
    }
    else {
    var msg = "Don't forget to bookmark us!";
    if(navigator.appName == "Netscape") msg += " (CTRL-D)";
    document.write(msg);
    }
    // End -->
    </SCRIPT>

  3. #3
    Join Date
    Aug 2000
    Location
    Placitas, New Mexico, USA
    Posts
    41,533

    Default Re: Adding a "Bookmark This Page" link

    Need more specific instruction please, James.

  4. #4
    Join Date
    Aug 2010
    Posts
    533

    Default Re: Adding a "Bookmark This Page" link

    Sorry that was untested

    This one does work in xara.
    Copy the code below and right click on your page and select Paste HTML placeholder, this will add a small rectangle which will be replaced by the code when exported. This code needs to be placed in the Head section of your page so while the rectangle is selected using the yellow tag icon name it <head>
    Code:
    <script type="text/javascript">
    
    /***********************************************
    * Bookmark site script- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
    * This notice MUST stay intact for legal use
    * Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
    ***********************************************/
    
    /* Modified to support Opera */
    function bookmarksite(title,url){
    if (window.sidebar) // firefox
        window.sidebar.addPanel(title, url, "");
    else if(window.opera && window.print){ // opera
        var elem = document.createElement('a');
        elem.setAttribute('href',url);
        elem.setAttribute('title',title);
        elem.setAttribute('rel','sidebar');
        elem.click();
    }
    else if(document.all)// ie
        window.external.AddFavorite(url, title);
    }
    </script>
    Then create a button or text link using the following as the url. You need to change the highlighted text to suit.
    javascript:bookmarksite('BOOKMARK TITLE HERE', 'http://www.yourdomain.com')

    Here is an example
    Attached Files Attached Files

  5. #5
    Join Date
    Apr 2010
    Location
    NZ
    Posts
    27

    Default Re: Adding a "Bookmark This Page" link

    Many thanks, James and Gary; I'll give it a whirl.

  6. #6

    Default Re: Adding a "Bookmark This Page" link

    Yup, thanks from me too. Just used it and it works a treat. Nice.

 

 

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
  •