Bookmark Code for All Browsers

D

Dave

Hello:
I am trying to add a hyperlink to my website so that visitors will be able
to bookmark my site by clicking on it.
I know which code works for IE:
<A
HREF="javascript:window.external.AddFavorite('http://www.myswebsite.com','PHP
Freaks')">Bookmark this Site!</A>

BUT it does not work for Netscape and FireFox.

Does anybody know how to make the same work for Netscape and FireFox?

Thank you very much!
 
S

Steve Easton

<SCRIPT language="JavaScript">
<!--
if ((navigator.appVersion.indexOf("MSIE") > 0)
&& (parseInt(navigator.appVersion) >= 4)) {
document.write("<a href='#' onclick='window.external.
AddFavorite(location.href, document.title);'>
Add this page to your favorites!</a>");
}
file://-->
</SCRIPT>

--
Steve Easton
Microsoft MVP FrontPage
95isalive
This site is best viewed............
........................with a computer
 
J

Jens Peter Karlsen [FP-MVP]

How is that going to work in Netscape and Firefox as asked about?

Regards Jens Peter Karlsen. Microsoft MVP - Frontpage.
 
J

Jens Peter Karlsen [FP-MVP]

Not possible.
Usually people write "Press CTRL-D to bookmark this page" on the page.

Regards Jens Peter Karlsen. Microsoft MVP - Frontpage.
 
D

Dave

Thank you all your help, Steve!

Steve Easton said:
<SCRIPT language="JavaScript">
<!--
if ((navigator.appVersion.indexOf("MSIE") > 0)
&& (parseInt(navigator.appVersion) >= 4)) {
document.write("<a href='#' onclick='window.external.
AddFavorite(location.href, document.title);'>
Add this page to your favorites!</a>");
}
file://-->
</SCRIPT>

--
Steve Easton
Microsoft MVP FrontPage
95isalive
This site is best viewed............
........................with a computer
 
S

Steve Easton

It's right out of the MSDN library.

--
Steve Easton
Microsoft MVP FrontPage
95isalive
This site is best viewed............
........................with a computer
 
B

Bob Lehmann

All this will do is check for IE and provide a link only if the browser is
IE version >=4.

Perhaps Google the link I provided.

Bob Lehmann
 
B

Bob Lehmann

How did this solve your problem? Non-IE version >=4 will not see the link.

Bob Lehmann
 
D

Dave

Yes, I did Google for Add to Favourites, and installed the following script:

<script type="text/javascript">
if ((navigator.appName == "Microsoft Internet Explorer") &&
(parseInt(navigator.appVersion) >= 4)) {
var url="website";
var title="description";
document.write('<A HREF="javascript:window.external.AddFavorite(url,title)');
document.write('"<font color=#FFFFF4 face=tahoma size=8pt><b>Click to
Bookmark</b></font></a>');}
else {var alt = "<font color=#FFFFF4 face=tahoma size=2pt><b>To
bookmark<b/></font>";
if(navigator.appName == "Netscape") alt += "<font color=#FFFFF4 face=tahoma
size=2pt><b> - Press (Ctrl+D)<b/></font>";
document.write(alt);}
</SCRIPT>

Thank you all - Terrific Message Board!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top