isHomePage Method
Determines whether the specified URL refers to the client's home page.
Syntax
bQueryHome = homePage.isHomePage(sPageURL)
Parameters
sPageURL Required. A String that specifies the path or file name to compare against a client's specified home page.
Return Value
A Boolean. Returns one of the following values:
true- The client's home page is the same as the provided argument.
false- The client's home page is different than the provided argument.
Remarks
The isHomePage method returns
falseif the argument and a user's home page are the same, but the document calling the method is on a different domain from the user's home page.
Example
This example uses the isHomePage method to determine whether a user's home page is the same as the specified URL.
<HTML XMLNS:IE> <HEAD> <STYLE> @media all { IE\:HOMEPAGE {behavior:url(#default#homepage)} } </STYLE> <SCRIPT> function fnVerify(){ sQueryHome = oHomePage.isHomePage(oHomeHref.value); alert(sQueryHome); event.returnValue = false; } </SCRIPT> </HEAD> <BODY> <IE:HOMEPAGE ID="oHomePage" /> <INPUT TYPE=text ID=oHomeHref VALUE="http://www.microsoft.com"> <INPUT TYPE=button VALUE="Verify" onclick="fnVerify()"> </BODY> </HTML>Code example: http://samples.msdn.microsoft.com/workshop/samples/author/behaviors/isHomePage1.htm
Applies To
homePage
See Also
Introduction to DHTML Behaviors
>>document.body.style.behavior = 'url(#default#homepage)'
"url(#default#homepage)"
----------------------------------------------------------------------
>>document.body.isHomepage('http://www.google.com')
false
If you run that bit of code on window load either in-line in the page or via an included JS file from a domain you control (and obviously changing google.com to that domain), the method returns true as expect.
- 12/30/2009
- Jackson-Gabbard
the function which firefox doesnt support,any idea of the substitute
[Noelle Mallory - MSFT] Please post questions to the MSDN Forums at http://forums.microsoft.com/msdn. You will likely get a quicker response through the forum than through the Community Content.
- 12/6/2007
- lokoo
- 12/6/2007
- Noelle Mallory