Click to See Complete Forum and Search --> : homepage
stancreator
07-17-2003, 04:51 AM
hello all, if any of you can help me with this i will be ver greatful. I'd like help with a javascript code that makes the page your on the users homepage. Basically it's just some text that says: 'click here to make this page your homepage'. then it will probably use the code historygo(0), or somthing like that. I'd just like to know how to do it.
requestcode
07-17-2003, 06:46 AM
Here is a example:
<html>
<head>
<title>Home Page/Book Mark</title>
<script language="JavaScript">
function bookit()
{
if (document.all)
{
window.external.AddFavorite("http://www.yoursite.com/","Your Site Name")
}
}
</script>
</head>
<body bgcolor="lightgreen">
<script language="JavaScript">
if(document.all)
{
document.write('<a href="#" onClick="this.style.behavior=\'url(#default#homepage)\';this.setHomePage(\'http://www.yoursite.com/\');">Click here to make My Site your default homepage</a>')
document.write('<br><br>')
document.write('<a href="JavaScript:bookit()">Click here to bookmark this site</a>')
}
</script>
</body>
</html>
This also shows an example to bookmark the page. Both of these features are IE only so you won't see the links for NS.