SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    Skills to Pay the Bills Sparkie's Avatar
    Join Date
    Jul 1999
    Location
    A cave with 47 computers and an internet feed
    Posts
    3,559
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Talking crossbrowser bookmark with image

    I'd like my visitors to be able to click on a "bookmark this site" image and be presented with the appropriate box to bookmark the site (whether they're using IE or netscape). The only one's I've seen use text, and the javascript is a bit too over-my-head so I thought I'd pop in here and ask if anyone knows where I can find such a script.

  2. #2
    SitePoint Guru Vincent Puglia's Avatar
    Join Date
    Feb 2000
    Location
    where the World once stood
    Posts
    700
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi Sparkie,

    AFAIK, you cannot 'automatically' add a bookmark to NN4; the user has to manually add the site. For IE-compatible browsers, see the "Add to Favorites" script/tutorial at my site. I've never bothered to find out for NN6

    Vinny
    Where the World Once Stood
    the blades of grass
    cut me still

  3. #3
    Skills to Pay the Bills Sparkie's Avatar
    Join Date
    Jul 1999
    Location
    A cave with 47 computers and an internet feed
    Posts
    3,559
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi Vinny,

    I use this script on another site of mine, and it seems to work in Netscape (6..dont know about 4) and IE 4+.

    <SCRIPT LANGUAGE="JavaScript">
    <!-- Begin
    if ((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion) >= 4)) {

    var url="http://www.mascotartist.com";
    var title="MascotArtist.com";

    document.write('<A HREF="javascript:window.ext');
    document.write('ernal.AddFavorite(url,title);" ');
    document.write('onMouseOver=" window.status=');
    document.write("'Click to Bookmark us!'; return true ");
    document.write('"onMouseOut=" window.status=');
    document.write("' '; return true ");
    document.write('">Click to Bookmark us!</a>');
    }
    else {
    var msg = "Don't forget to bookmark us!";
    if(navigator.appName == "Netscape") msg += " (CTRL-D)";
    document.write(msg);
    }

    // End -->
    </script>

    The problem is getting it to work entirely with an image, so that you can click the image and get the same prompt that lets you bookmark/add a site to favorites.

  4. #4
    SitePoint Guru Vincent Puglia's Avatar
    Join Date
    Feb 2000
    Location
    where the World once stood
    Posts
    700
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi Sparkie,

    Maybe I don't understand the problem. What's wrong with:

    <a href="#" onClick='bookIt()' onMouseover='....'><img src....></a>

    function bookIt()
    {
    if (document.all)
    window.external....
    else
    .......
    }

    Vinny
    Where the World Once Stood
    the blades of grass
    cut me still

  5. #5
    Skills to Pay the Bills Sparkie's Avatar
    Join Date
    Jul 1999
    Location
    A cave with 47 computers and an internet feed
    Posts
    3,559
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Probably nothing! I just didnt know how to take out the text and place an image within the script! Can you include the entire script that shows how?

  6. #6
    SitePoint Guru Vincent Puglia's Avatar
    Join Date
    Feb 2000
    Location
    where the World once stood
    Posts
    700
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi Sparkie,

    Use the bookIt() at my site (add to favorites script) and make your html code look like the following:

    <a href="#" onclick="bookIt('http://members.aol.com/grassblad|GrassBlade')" onMouseOver="window.status='Click to Bookmark us!'; return true"><img src="http://members.aol.com/grassblad/images/bnrGBlad.gif"></a>

    You don't need a mouseout; that's overkill

    Vinny
    Where the World Once Stood
    the blades of grass
    cut me still


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
  •