View Full Version : how to add a certain page to the browser home page
jasongr
11-22-2004, 08:18 PM
Hello
I have 2 pages in the application.
In page A.html, the user configures some settings.
When the user is done, he clicks on a button titled 'Next' and is taken to page B.html where a success message is displayed.
One of the configuration settings in page A.html is a checkbox which allows the user to decide whether he wants to set a specific site as his browser home page.
I want to prompt the user with the home page confirmation box when page B.html is loaded (if the user selected this configuration setting)
Can anyone show me how this can be done?
Is it only possible in IE? What about other browsers?
thanks in advance
function alrt()
{
alert("congratulations!")
}
</script>
<onload=alrt()>
that should display a message when the page loads, the code in red is what you put on page B. hope that helped you out, good luck
jasongr
11-23-2004, 03:25 AM
what?
I didn't ask how to display an alert when the page loads.
I know how to do this
I asked how to display the special confirmation box that askes the user if he wants to set a page to his browser home page. This is a special confirmation box
hysterio
11-24-2004, 12:08 PM
var ok = window.confirm('Do yo want this page as homepage?');
if (ok) {
window.external.AddFavorite('http://www.hysterio2003.tk','hysterio \'s Homepage');
}
hope this helps
jasongr
11-24-2004, 02:14 PM
Actually, this adds the page to the favorites list and doesn't make the page into the default home page
thanks anyways
I might use it in the future
hysterio
11-25-2004, 04:30 AM
Originally posted by jasongr
Actually, this adds the page to the favorites list and doesn't make the page into the default home page
thanks anyways
I might use it in the future
my fault :)
add this to the body of your webpage:
<ie:homepage id="homepage" style="behavior:url(#default#homepage)">
and edit javascript like this:
var ok = window.confirm('Do yo want this page as homepage?');
if (ok) {
homepage.setHomePage('http://www.hysterio2003.tk/');
}
or just use "homepage.setHomePage('http://www.hysterio2003.tk/');" because it's giving already a question to the user if he wants to set this page is homepage
jasongr
11-25-2004, 04:53 AM
here is my solution in JavaScript (utilizing a hidden anchor):
<head>
<script language="JavaScript" type="text/javascript">
<!--
function pageLoaded() {
var hiddenLink = document.getElementById('dummy');
hiddenLink.style.behavior='url(#default#homepage)';
hiddenLink.setHomePage('http://www.webdeveloper.com');
}
-->
</script>
</head>
<body onload="pageLoaded();">
<a href="#" id="dummy" style="display:none"></a>
</body>
I hope other developers will find it useful
vBulletin® v3.6.7, Copyright ©2000-2009, Jelsoft Enterprises Ltd.