The following code is used to add a link that, when clicked, adds the current page to the user's Favorites folder. There are two versions, one to use if you serve the same page to all users, regardless of browser version, and one if you are sure the user has Internet Explorer 4.0 or higher.
This script does its own client-side browser detection.
<SCRIPT>
<!--
if ((navigator.appVersion.indexOf("MSIE") > 0)
&& (parseInt(navigator.appVersion) >= 4)) {
document.write("<U>
<SPAN STYLE='color:blue;cursor:hand;'
onclick='window.external.
AddFavorite(location.href, document.title);'>
Add this page to your favorites</SPAN>
</U>");
}
//-->
</SCRIPT>
This script assumes you perform browser detection on the server or have a homogenous Internet Explorer 4. x or better environment.
<U><SPAN STYLE='color:blue;cursor:hand;' onclick='window.external. AddFavorite(location.href, document.title);'> Add this page to your favorites</SPAN></U>