With only a few JavaScript lines you can initiate the dialog for "Add to Favorites" dialog in Internet Explorer and the "Add to Bookmarks" dialog in Firefox, as shown in this example.
- <script type=“text/javascript”>
- var BookmarkURL=“http://www.geekpedia.com”
- var BookmarkTitle=“Geekpedia”
- // If the browser is Internet Explorer
- if (document.all)
- {
- // Add to Favorites (Internet Explorer)
- window.external.AddFavorite(BookmarkURL,BookmarkTitle)
- }
- else
- {
- // Add to Bookmarks (Mozilla Firefox)
- window.sidebar.addPanel(BookmarkTitle, BookmarkURL, ”);
- }
- </script>