Baumeister Mediasoft Engineering BME - Baumeister Mediasoft Engineering  JavaScript Application: Add a Page/URL to Internet Explorer Favorites (IE4) - English Version JavaScript-Anwendung: Webseite/URL zu Internet Explorer Favoriten hinzufügen (IE4) - Deutsche Version
Baumeister Mediasoft Engineering
Bartels AutoEngineerCarLogServicesResourcesCompany ProfileContact Us
Baumeister Mediasoft Engineering » Resources » Web Development » JavaScript » Applications » Add to Favorites
JavaScript Applications

JavaScript Application: Add a Page/URL to Internet Explorer Favorites (IE4)

Baumeister Mediasoft Engineering

The AddFavorite() JavaScript function can be used in Internet Explorer (version 4 or higher) to add a web address (with a title) to the Internet Explorer favorites. AddFavorite() activates the Add to Favorites... function from the Internet Explorer Favorites menu with the given parameters.

The following AddFavorite() call can be used to add the BME website address with its title to the Internet Explorer favorites:

window.external.AddFavorite(
    
'http://www.bme.ie',
    
'BME - Baumeister Mediasoft Engineering'
    
);

The following AddFavorite() call can be used to add the currently loaded page to the Internet Explorer favorites:

window.external.AddFavorite(location.hrefdocument.title);

A web browser compatibility check such as

if (window.external)
{
   
window.external.AddFavorite(location.hrefdocument.title);
}

is recommended since AddFavorite() is only available in Internet Explorer (version 4 or higher).

onclick() can be used to provide a clickable link to the AddFavorite() function call. The following JavaScript code displays a link for adding the currently loaded page to the Internet Explorer favorites:

<script>
<!--
//--><![CDATA[//><!--
if (window.external)
{
    
document.write(
        
'<a href="#"'
        
' onclick="window.external.AddFavorite(location.href,document.title);">'
        
'Add this Page to your Favorites...</a>'
        
);
}
//--><!]]>
</script>

Related Links

Related Topics

Baumeister Mediasoft Engineering » Resources » Web Development » JavaScript » Applications » Add to Favorites

JavaScript Application: Add a Page/URL to Internet Explorer Favorites (IE4) • © 2023 Manfred Baumeister • Updated: 29 October 2008, 14:15 [UTC]

Baumeister Mediasoft Engineering, Clontarf, Dublin 3, D03 HA22, Ireland
© 2023 Manfred Baumeister

JavaScript Application: Add a Page/URL to Internet Explorer Favorites (IE4) - English Version JavaScript-Anwendung: Webseite/URL zu Internet Explorer Favoriten hinzufügen (IE4) - Deutsche Version