external.AddFavorite() (Method)

Support for external applications and objects when using MSIE in the Windows environment. This adds an item to the favorites collection.

Availability:

JScript - 5.0
Internet Explorer - 5.0
JavaScript syntax:IEmyExternal.AddFavourite(aURL)
IEmyExternal.AddFavourite(aURL, aName)
Argument list:aURLA Url for a link in the bookmarks list
aNameThe name that goes in the menu list

With this method, you can add your own bookmarks to the favorites menu.

You must specify a URL value (otherwise there is no point in adding the bookmark). However, you need not specify the second argument which is the text displayed in the menu.

Typically you might provide a button on the page called "bookmark me" which might call some script to work out what the real URL should be. This gets round one of the major problems with framed sites in that a bookmark usually yields unpredictable results since you are accessing the site at a sub-framed level.

Example code:

   // Bookmark a page from its current location
   // using its document title string as an
   // identifying text.
   window.external.AddFavorite(location.href, document.title);