Forum Moderators: open

Message Too Old, No Replies

add page to favorites

how to make a link that adds the current page to your favorites

         

myacidpacemaker

9:18 am on Aug 26, 2005 (gmt 0)

10+ Year Member



just wondering if anyone knows how i can make a link that once clicked will add the page to the user's favorites.

below is the script im currently using but i have to manually enter the address. i want to put the add to favorites link on a dynamic page so i want the address of the current page to be added to favourites.

<a href="javascript:window.external.AddFavorite('http://xyz.com/','xyz.com - home')" onMouseOver="MM_displayStatusMsg('click to add this page to your Favorites');return document.MM_returnValue" onMouseOut="MM_displayStatusMsg('');return document.MM_returnValue"><img src="images/favs.gif" width="16" height="16" border="0" align="middle">Add this page to your Favourites</a>

thnx for your help.
Josh.

Alternative Future

9:47 am on Aug 26, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi Josh,

Is it a script something like this you are after?

<html>
<head>
<script>
URL = window.location.href;
</script>
</head>
<body>
<script>
document.write("<a href='"+URL+"'>");
</script>we are here currently</a>
</body>
</html>

-George

myacidpacemaker

12:17 pm on Aug 27, 2005 (gmt 0)

10+ Year Member



hey george,

yeh thats kinda what i want except that i want to be able to put the document.write handler within the javascript tag so that if a user clicks the add to favourites link on a dynamic page it will add that exact page to their favourites list, ie: my_page.php?id=001

i dont really know much about js so my apologies if this is a dumb question.

so what im after is this...

javascript:window.external.AddFavorite('http://js_inserts_page_url_here/','and_page_title_here')

also just wondering if theres an equivalent for this to add a bookmark for firefox/mozilla?

josh.

encyclo

12:37 pm on Aug 27, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Something like:

window.external.AddFavorite(location.href, document.title);

myacidpacemaker

12:55 pm on Aug 27, 2005 (gmt 0)

10+ Year Member



just what i was after. cheers!