You are here: Reference > JavaScript > client-side > browser > methods > AutoScan (external)

AutoScan method (external)

Browser support:
7
Attempts to find a Web site based on the specified domain part.
The AutoScan method iterates through the patterns located under HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\Main\UrlTemplate in the system registry and creates URL addresses based on the patterns and the specified domain part (the '%s' substrings in the patterns are replaced with the specified domain part).
The AutoScan method tries to connect to the created URL in each step and if it succeeds, then stops the iteration and loads the page into the window identified by the third parameter. If no valid URL is found, it opens the page specified by the second parameter. The following patterns are specified in the system registry by default:
  • www.%s.com
  • www.%s.org
  • www.%s.net
  • www.%s.edu
This method does not work in Internet Explorer from version 7 and raises an exception.

Syntax:

object.AutoScan (domainPart[, defaultURL [, target]]);
You can find the related objects in the Supported by objects section below.

Parameters:

domainPart
Required. String that specifies the domain part.
defaultURL
Optional. String that specifies the location of the default page that will be displayed if no matching web site is found. If this parameter is not specified and no match is found, the default error page will be displayed.
target
Optional. String that identifies the target window where the page needs to be displayed.
One of the following values:
name
The name of a window, frame, or iframe.
_blank
Indicates a new window.
_media
Indicates the HTML content area of the Media Bar.
_parent
Indicates the parent frame.
_search
Indicates the browser search panel.
_self
Default. Indicates the frame containing the source link.
_top
Indicates the topmost window.

Return value:

This method has no return value.

Example HTML code 1:

This example illustrates the use of the AutoScan method.
<head>
    <script type="text/javascript">
        function FindPage () {
            try {
                window.external.AutoScan ("dottoro", "", "_blank");
            }
            catch (e) {
                alert (e.message);
            }
        }
    </script>
</head>
<body>
    <button onclick="FindPage ();">Find dottoro home page</button>
</body>
Did you find this example helpful? yes no

Supported by objects:

Related pages:

External links:

User Contributed Comments

Post Content

Post Content