SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    googlicious graymatter bvarvel's Avatar
    Join Date
    Sep 2002
    Location
    Katy, TX
    Posts
    956
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Bookmarking Script, how-to?

    I have the following script that works beautifully in IE:

    PHP Code:
     <SCRIPT LANGUAGE="JavaScript">
                 function addbookmark()
                 {
                 bookmarkurl="<?php echo $doc_root;?>/library/<?php echo $id;?>/"
                 bookmarktitle="<?php echo $title;?>"
                 if (document.all)
                 window.external.AddFavorite(bookmarkurl,bookmarktitle)
                 }
             //  End -->
     </script>
    Anyone know howI can make it cross-browser???

  2. #2
    chown linux:users\ /world Hartmann's Avatar
    Join Date
    Aug 2000
    Location
    Houston, TX, USA
    Posts
    6,455
    Mentioned
    11 Post(s)
    Tagged
    0 Thread(s)
    I am fairly sure there is no cross-browser way to do this since the window.external.AddFavorite() function is only supported by IE.

  3. #3
    googlicious graymatter bvarvel's Avatar
    Join Date
    Sep 2002
    Location
    Katy, TX
    Posts
    956
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I have no problem dumping this script. I'm looking for a replacement that might be cross-browsers compatible.

  4. #4
    chown linux:users\ /world Hartmann's Avatar
    Join Date
    Aug 2000
    Location
    Houston, TX, USA
    Posts
    6,455
    Mentioned
    11 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by bvarvel
    I have no problem dumping this script. I'm looking for a replacement that might be cross-browsers compatible.
    But that's just it, I don't think other browsers support the bookmarking ability since it is 'outside' the browser's screen.

  5. #5
    googlicious graymatter bvarvel's Avatar
    Join Date
    Sep 2002
    Location
    Katy, TX
    Posts
    956
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    aah... gotcha! thanks.

  6. #6
    SitePoint Wizard silver trophybronze trophy asp_funda's Avatar
    Join Date
    Jun 2003
    Location
    ether
    Posts
    4,497
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Yeah, if you make a cross-browser script for this, then you check whether the browser is IE or NN. If its IE, then you open the Favourites Dialog by executing the AddFavourite() command & if its NN then you display an alert box saying "Press Ctrl+D to bookmark me mate!".


    Just like Hartmann said, any bookmark script is IE only.
    Our lives teach us who we are.
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    Me - Photo Blog - Personal Blog - Dev Blog
    iG:Syntax Hiliter -- Colourize your code in WordPress!!


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
  •