addPanel method (sidebar)
Displays the 'Add Bookmark' dialog box for the specified URL and title in Firefox.
Use the AddFavorite method for similar functionality in Internet Explorer.
Opera, Google Chrome and Safari do not provide a way to add new elements to the Favorites (Bookmarks) from JavaScript.
Syntax:
You can find the related objects in the Supported by objects section below.
Parameters:
Required. String that specifies the name of the page that you want to add to the bookmarks. | |||||||
Required. String that specifies the URL of the page that you want to add to the bookmarks. | |||||||
Required. String that specifies the customized URL that you want to add. |
Return value:
This method has no return value.
Example HTML code 1:
This example shows how to add a page to the Favorites (Bookmarks) in Internet Explorer and Firefox.
|
||||
<head> <script type="text/javascript"> function AddToFavorites () { if (window.sidebar) { // Firefox window.sidebar.addPanel ('Dottoro help page', 'http://help.dottoro.com', ''); } else { if (window.external && ('AddFavorite' in window.external)) { // Internet Explorer window.external.AddFavorite ('http://help.dottoro.com','Dottoro help page'); } else { // Opera, Google Chrome and Safari alert ("Your browser doesn't support this example!"); } } } </script> </head> <body> <button onclick="AddToFavorites ();">Add to favorites</button> </body> |
||||
|
||||
Did you find this example helpful?
|
Supported by objects:
Related pages:
External links:
User Contributed Comments