Results 1 to 3 of 3

Thread: bookmark script

  1. #1
    Join Date
    Nov 2007
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Unhappy bookmark script

    1) Script Title:
    bookmarksite
    2) Script URL (on DD):
    "javascript:bookmarksite"
    3) Describe problem:

    I am enclosing the script I copied to see if you can help. When I try to run it I get an error on page as described:

    <html>

    <head>

    <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 (v9 tested) */
    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>
    </head>

    <body>
    <a href="javascript:bookmarksite('Yahoo', 'http://www.yahoo.com');">Bookmark Yahoo</a>
    </body>
    </html>

    <!--

    *******************************************

    I set up a simple html file to test the bookmark before using it on my site, but I am getting the following error:

    Line: 24
    Char: 2
    Error: Object doesn't support this propertty or method
    Code: 0
    URL file: //etc

    I am using windows Vista basic edition

    **********************************************

    -->

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Some of the IE extended functions are blocked in Vista, but it might be just that this works live and not locally. Did you test your page on the server, or just on your hard drive? Does the demo page on Dynamic Drive for this script work for you?
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Nov 2007
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    i only tried it locally but thanks i'll give it a go.

    yes the demo does work so i think you have solved it for me - thanks

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
  •