nedwob
asked on
Put an 'Add to Favorites' button on a Page
I assume that javascript is the language to do this.
I want to place a button or link on a page that will adde the page URL to the 'Favorites' listings.
I can't find anything in any books I have and a web search didn't come up with anything.
Can anyone please help?
thanks
nedwob
I want to place a button or link on a page that will adde the page URL to the 'Favorites' listings.
I can't find anything in any books I have and a web search didn't come up with anything.
Can anyone please help?
thanks
nedwob
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Or another way...
<A HREF="javascript:window.ex ternal.Add Favorite(' http://www.mysite.com/anotherdir/thispage.html', 'Title of the bookmark')">Add this page to your favorites!</A>
<A HREF="javascript:window.ex
Actually, that is pretty much the same way--both use:
window.external.AddFavorit e(bookmark url,bookma rktitle)
Fritz the Blank
window.external.AddFavorit
Fritz the Blank
Here is another Javasript code. Add to favourites text is displayed in explorer, but if the user is using Netscape then they are prompted to press ctrl-D.
Just paste the code wherever you want it to appear.
<SCRIPT LANGUAGE="JavaScript">
<!--
if ((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVer sion) >= 4)) {
var url="http://www.yoursite.com";
var title="Your site description";
document.write('<A HREF="javascript:window.ex ternal.Add Favorite(u rl,title); " ');
document.write('onMouseOve r=" window.status=');
document.write("'Add our site to your favorites!'; return true ");
document.write('"onMouseOu t=" window.status=');
document.write("' '; return true ");
document.write('">Add our site to your favorites!</a>');
}
else {
var msg = "Don't forget to bookmark us!";
if(navigator.appName == "Netscape") msg += " (CTRL-D)";
document.write(msg);
}
// -->
</script>
Just paste the code wherever you want it to appear.
<SCRIPT LANGUAGE="JavaScript">
<!--
if ((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVer
var url="http://www.yoursite.com";
var title="Your site description";
document.write('<A HREF="javascript:window.ex
document.write('onMouseOve
document.write("'Add our site to your favorites!'; return true ");
document.write('"onMouseOu
document.write("' '; return true ");
document.write('">Add our site to your favorites!</a>');
}
else {
var msg = "Don't forget to bookmark us!";
if(navigator.appName == "Netscape") msg += " (CTRL-D)";
document.write(msg);
}
// -->
</script>
<script language="JavaScript">
<!-- Begin
if ((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVer sion) >= 4)) {
var url="http://youraddress.com";
var title="Your Site Title";
document.write('<A HREF="javascript:window.ex t');
document.write('ernal.AddF avorite(ur l,title);" ');
document.write('onMouseOve r=" window.status=');
document.write("'Bookmark Us!'; return true ");
document.write('"onMouseOu t=" window.status=');
document.write("' '; return true ");
document.write('">Bookmark Us!</a>');
}
else {
var msg = "Bookmark Us!";
if(navigator.appName == "Netscape") msg += " (Please Bookmark Us Now Ctrl D)";
document.write(msg);
}
// End -->
</script>
<!-- Begin
if ((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVer
var url="http://youraddress.com";
var title="Your Site Title";
document.write('<A HREF="javascript:window.ex
document.write('ernal.AddF
document.write('onMouseOve
document.write("'Bookmark Us!'; return true ");
document.write('"onMouseOu
document.write("' '; return true ");
document.write('">Bookmark
}
else {
var msg = "Bookmark Us!";
if(navigator.appName == "Netscape") msg += " (Please Bookmark Us Now Ctrl D)";
document.write(msg);
}
// End -->
</script>
ASKER
Thanks to all for the quick replies. I will look at the suggestions, and come back in a few days to award the points
nedwob
nedwob
ASKER
Thanks to all for the comments - I have tried the suggestion from 'fritz the blank' at the URL http://www.dynamicdrive.com/dynamicindex9/addbook.htm. It works fine. As fritz made the most comments he gets the points.
nedwob
nedwob
nedwob,
Glad to have helped. Any reason for the B? Is there anything else that you needed?
Fritz the Blank
Glad to have helped. Any reason for the B? Is there anything else that you needed?
Fritz the Blank
ASKER
hi fritz the blank
No - I meant to hit A, but finger trouble caused me to hit the B I guess!
No other problems at present
nedwob
No - I meant to hit A, but finger trouble caused me to hit the B I guess!
No other problems at present
nedwob
Okay, I'll drop a note to community support requesting a change.
Fritz the Blank
Fritz the Blank
ASKER
Yes - please do - your answers and links certainly merit an A.
nedwob
nedwob
Thanks!!!
Fritz the Blank
Fritz the Blank
if (document.all)
window.external.AddFavorit
}
<a href="javascript:addbookma
Fritz the Blank