Click to Rate and Give Feedback
MSDN
MSDN Library
Web Development
HTML and CSS
DHTML Behaviors
Methods
 setHomePage Method

  Switch on low bandwidth view
setHomePage Method

Sets a user's home page to the specified value.

Syntax

homePage.setHomePage(sPageURL)

Parameters

sPageURL Required. A String that specifies the path or file name of the user's home page.

Return Value

No return value.

Remarks

The setHomePage method prompts the user to confirm the new home page value before setting the value on the browser.

This method requires a user-initiated action, such as clicking on a link, or tabbing to a link and pressing enter. The Pop-up Blocker feature in Microsoft Internet Explorer 6 prevents this method from executing automatically.

Example

This example uses the setHomePage method to set a user's home page.

<HTML XMLNS:IE>
<HEAD>
<STYLE>
@media all {
   IE\:HOMEPAGE {behavior:url(#default#homepage)}
}
</STYLE>

<SCRIPT>
function fnSet(){
	oHomePage.setHomePage(oHomeHref.value);
	event.returnValue = false;
}
</SCRIPT>
</HEAD>
<BODY>
<IE:HOMEPAGE ID="oHomePage" />
<INPUT TYPE=text ID=oHomeHref VALUE="http://www.microsoft.com">
<INPUT TYPE=button VALUE="Set" onclick="fnSet()">
</BODY>
</HTML>
This feature requires Microsoft Internet Explorer 5 or later. Click the following icon to install the latest version. Then reload this page to view the sample.

Standards Information

There is no public standard that applies to this method.

Applies To

homePage

See Also

Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Permission denied error in IE 7, when using setHomePage      ekkinn   |   Edit   |   Show History
I tried to reuse a script that uses the setHomePage method, that worked fine few months ago on both IE 6 and IE 7. Now it still works in IE6 but comes up with an runtime error "Permission denied" in IE 7, and the script debugger point at 'document.body.setHomePage('http://SamePage.astheSciptIsRunningOn.com');'. I tried the example on the this page also, and other samples that have been working so far, but IE 7 always comes with this error. I found a few post where other people have run into this problem recently, but no explanation or solution. Have there been some changes in the IE 7 security that prevents this method to run? I am testing on Vista Ultimate SP 1, with IE 7.0.6001.18000.

----

Sorry, this was a misunderstanding. I found out that there had been a recently implemented group policy on our network, that prevented users from changin the home page.
Tags What's this?: Add a tag
Flag as ContentBug
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker