Click to return to the DHTML, HTML     
isComponentInstalled Meth...     load Method     Default Behaviors Referen...    
Web Workshop  |  DHTML, HTML & CSS

isHomePage Method


Determines whether the specified URL refers to the client's home page.

Syntax

bQueryHome = oHomePage.isHomePage(sPageURL)

Parameters

sPageURL Required. String that specifies the path and/or file name to compare against a client's specified home page.

Return Value

Boolean. Returns true if the client's Web page is the same as the provided argument, or false otherwise.

Remarks

The isHomePage method returns false if the argument and a user's home page are the same, but the document calling the method is on a different domain than 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.

Sample Code

<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>
This feature requires Microsoft® Internet Explorer 5 or later. Click the icon below to install the latest version. Then reload this page to view the sample.
Microsoft Internet Explorer

Applies To

[ Object Name ]
PlatformVersion
Win16:
Win32:
Mac:
Unix:
WinCE:
homePage

See Also

DHTML Behaviors


Back to topBack to top

Did you find this topic useful? Suggestions for other topics? Write us!

© 1999 Microsoft Corporation. All rights reserved. Terms of use.