Bookmak this page - code?

admin

Administrator
Staff member
Can someone tell me how to include a link that bookmarks the page to favourites when clicked?<br />
<br />
Thanks<br />
<br />
GMS -UK<!--content-->HI Gms,<br />
<br />
see the following code. I am shure this will work<br />
<br />
<html><br />
<head><br />
<br />
<script language="Javascript"><br />
var bookmarkurl="http://www.whatever.com/whichfavourite.html"<br />
var bookmarktitle="HTML Help Homepage"<br />
<br />
function addbookmark(){<br />
if (document.all)<br />
window.external.AddFavorite(bookmarkurl,bookmarktitle)<br />
}<br />
</script><br />
</head><br />
<br />
<body><br />
<script Language="JavaScript"><br />
bookmark()<br />
function bookmark(){<br />
var version = 0;<br />
if(navigator.userAgent.indexOf('AOL') !=-1);<br />
else<br />
document.write("<INPUT TYPE='button' VALUE='Bookmark Now!' onClick='addbookmark()'>");<br />
}<br />
</SCRIPT><br />
</body><br />
</html><br />
<br />
AMRUTA..<!--content-->Another example<br />
<br />
<html><br />
<head><br />
<title>test</title><br />
</head><br />
<body><br />
<SCRIPT LANGUAGE="JavaScript"><br />
function bookmark(url, description)<br />
{<br />
<br />
netscape="Push OK and then Ctrl+D to add a bookmark"<br />
<br />
if (navigator.appName=='Microsoft Internet Explorer')<br />
{<br />
window.external.AddFavorite(url, description);<br />
}<br />
else if (navigator.appName=='Netscape')<br />
{<br />
alert(netscape);<br />
}<br />
}<br />
//--><br />
</SCRIPT><br />
<A HREF=http://www.htmlforums.com/archive/index.php/"javascript:bookmark('the URL','Name and description of site');">Link text or image.</A><br />
</body><br />
</html><br />
<br />
Insert the link as needed. Change URL and description to what you want.<!--content-->Thanks Whkoh & amruta<br />
<br />
Both work fine <br />
<br />
appreciated<br />
<br />
GMS UK<!--content-->Doesn't Netscape support this kind of bookmarking, or are there scripts out there that do this?<!--content-->I don't think that NS supports JS bookmarking.<!--content-->yep very true, Netscape doesn't support it. You could always check dynamicdrive.com and see all the different pretty scripts.<!--content--><a href=http://www.htmlforums.com/archive/index.php/"javascript:window.external.AddFavorite('SITE URL','FAVORITES TITLE')"><img src=http://www.htmlforums.com/archive/index.php/"IMAGE ADDRESS" width="117" height="20" border="0"></a><br />
<br />
Where:<br />
Favorites Title is: The heading it will be called when added to favorites, for example, "A1 Javascripts" or "Bills Site".<br />
<br />
<br />
works for me.......and it's allot shorter!<br />
:D<!--content-->
 
Back
Top