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

AddDesktopComponent method (external)

Browser support:
Adds an item (image or website with location) to the Microsoft Active Desktop.
Active Desktop needs to be installed in the user's computer for the AddDesktopComponent method to work. The Active Desktop has limited functionality (does not support the AddDesktopComponent method) on Windows XP with SP2 and it is removed from Windows Vista.

Syntax:

object.AddDesktopComponent (URL, type [, left [, top [, width [, height]]]]);
You can find the related objects in the Supported by objects section below.

Parameters:

URL
Required. String that specifies the location of a Web site or image.
type
Required. String that specifies the type of the item to add.
One of the following values:
image
Item is an image.
website
Item is a website.
left
Optional. Integer that sets the left position.
top
Optional. Integer that sets the top position.
width
Optional. Integer that sets the width of the item.
height
Optional. Integer that sets the height of the item.

Return value:

This method has no return value.

Example HTML code 1:

This example illustrates the use of the AddDesktopComponent method:
<head>
    <script type="text/javascript">
        function AddWebSiteToDesktop () {
            try {
                window.external.AddDesktopComponent ("http://help.dottoro.com", "website", 50, 50, 300, 300);
            }
            catch (e) {
                alert (e.message);
            }
        }

    </script>
</head>
<body>
    <button onclick="AddWebSiteToDesktop ();">Add a website to the Desktop!</button>
</body>
Did you find this example helpful? yes no

Supported by objects:

External links:

User Contributed Comments

Post Content

Post Content