PDA

View Full Version : "Make this page your homepage"


YakooMarkTwo
11-16-2004, 05:50 PM
I hope I'm in the right forum here. Is there a simple way to have a link on my site that says "Click here to make this site/page your homepage."? I believe in IE it's a ctrl-D thing, but does that work with all browsers? and how can I put that command in the form of a link? Or does anyone know off the tops of their heads of any sites that has a link like this that I can look at? Any help would be great, thanks!

petervazed
11-16-2004, 06:14 PM
Here's a simple JavaScript you can embed in any page on your site to allow your visitors
to bookmark your site with just one click:

<script language="JavaScript">
<!--
var bookmarkurl="http://www.Your_Site.com"
var bookmarktitle="Your_Title Here"
function addbookmark(){
if (document.all)
window.external.AddFavorite(bookmarkurl,bookmarktitle)
}
-->
</script>

<a href="javascript:addbookmark()">Add to Bookmarks</a>

Make this Page your homepage scripts:
http://www.google.com/search?hl=nl&q=script++%22make+this+page+your+homepage%22&btnG=Zoeken&lr=



:cool:

123456789
11-16-2004, 07:14 PM
You can do almost everything with JavaScript.

interpim
11-17-2004, 10:43 AM
I like this one, because if the user doesn't support Java this will catch it.

<script language="JavaScript">
<!--
function Add_A_Favorite()
{
if (window.external)
// if the browser is IE open the add favorite window
{
external.AddFavorite(location.href, document.title)
// Add the document location and title to the AddFavorite window
}
else
// Display and alert box for any other browser.
{
alert("Sorry, your browser doesn't support this feature." +
"\nPlease use the bookmark feature of your browser to save the location of this page.");
}

}
// -->
</script>

raasqwaaan
11-17-2004, 09:21 PM
Originally posted by petervazed
<script language="JavaScript">
<!--
var bookmarkurl="http://www.Your_Site.com"
var bookmarktitle="Your_Title Here"
function addbookmark(){
if (document.all)
window.external.AddFavorite(bookmarkurl,bookmarktitle)
}
-->
</script>

<a href="javascript:addbookmark()">Add to Bookmarks</a>
Just note that this is IE only; so if you're trying to find a solution that'll work in all browsers, this isn't it (as I recall, there isn't one anyway). This seems kind of pointless anyways; if someone wants to bookmark your page, then they will do so. Why have a useless link on your page?

Originally posted by interpim
I like this one, because if the user doesn't support Java this will catch it.

<script language="JavaScript">
<!--
function Add_A_Favorite()
{
if (window.external)
// if the browser is IE open the add favorite window
{
external.AddFavorite(location.href, document.title)
// Add the document location and title to the AddFavorite window
}
else
// Display and alert box for any other browser.
{
alert("Sorry, your browser doesn't support this feature." +
"\nPlease use the bookmark feature of your browser to save the location of this page.");
}

}
// -->
</script>

First of all, that's JavaScript, not Java, and no it won't. People without JavaScript won't get anything at all. All that does is check to see if window.external is supported so all non-IE browsers don't choke.