You are here: Reference > JavaScript > client-side > browser > methods > addPersistentPanel (sidebar)

addPersistentPanel method (sidebar)

Browser support:
Displays the 'Add Bookmark' dialog box for the specified URL and title in Firefox.
Same as the addPanel method.
  • In Internet Explorer, use the AddFavorite method for similar functionality.
  • Opera, Google Chrome and Safari do not provide a way to add new elements to the Favorites (Bookmarks) from JavaScript.

Syntax:

object.addPersistentPanel (title, URL, customizeURL);
You can find the related objects in the Supported by objects section below.

Parameters:

title
Required. String that specifies the name of the page that you want to add to the bookmarks.
URL
Required. String that specifies the URL of the page that you want to add to the bookmarks.
customizeURL
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.addPersistentPanel ('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? yes no

Supported by objects:

Related pages:

External links:

User Contributed Comments

Post Content

Post Content