Click to See Complete Forum and Search --> : HomePage with Java script
maha_osama
Oct 2nd, 2002, 02:00 AM
hi all
i'm new in the programming in Java script and i'd like to know how can i make my own Home page through java script and HTML
i don't know even how can i make Home page
thanx for all
Rick Bull
Oct 2nd, 2002, 05:10 AM
Do you mean make your page the user's home page when a link is clicked? Here's how to do that (and add to the bookmarks), but it will only work in IE I think:
<script type="text/javascript"><!--
function addToFavorites() {
if (window.external) window.external.AddFavorite(document.location.href, 'Title');
return false;
}
/*Makes your site the user's homepage*/
function setAsHomePage() {
this.style.behavior='url(#default#homepage)';
this.sethomepage(document.location.href);
return false;
}
//--></script>
<a href="#" onclick="return addToFavorites();">Bookmark</a> |
<a href="#" onclick="return setAsHomePage();">Home Page</a>
That will bookmark the current page. If you want to specify a particular location, change the text document.location.href in both functions to 'http://www.domain.com' (or whatever your site is).
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.