Title: Bookmark Us Script
Last modified: August 19, 2016

---

# Bookmark Us Script

 *  [theresel](https://wordpress.org/support/users/theresel/)
 * (@theresel)
 * [16 years, 4 months ago](https://wordpress.org/support/topic/bookmark-us-script/)
 * I’ve managed to insert a javascript call into my WordPress header which is supposed
   to provide a link for viewers to bookmark our site. Although the code is working
   perfectly when inserted into an html file and viewing it with IE or Netscape,
   it is not working with Netscape when I insert it into the php header file, it
   only works with IE. The link part is probably wrong, I took it from another wordpress
   page and just changed parameters so it’s picking up the translated text also.
 * Link in a regular html can be viewed at : [http://www.carnavalhearstcarnival.com/pratique.html](http://www.carnavalhearstcarnival.com/pratique.html)
   
   Link in the header can be viewed at : [http://www.carnavalhearstcarnival.com](http://www.carnavalhearstcarnival.com)
 * Both use the same script, except the latter is in a php page.
 * Can someone help?
 * My header contains the following code:
 * _Code moderated as per the[ Forum Rules](http://wordpress.org/support/topic/68664)_

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Thread Starter [theresel](https://wordpress.org/support/users/theresel/)
 * (@theresel)
 * [16 years, 4 months ago](https://wordpress.org/support/topic/bookmark-us-script/#post-1374412)
 * Oops, here’s the code in the head section:
 *     ```
       function bookmark_us(url, title){
   
       if (window.sidebar) // firefox
           window.sidebar.addPanel(title, url, "");
       else if(window.opera && window.print){ // opera
           var elem = document.createElement('a');
           elem.setAttribute('href',url);
           elem.setAttribute('title',title);
           elem.setAttribute('rel','sidebar');
           elem.click();
       }
       else if(document.all)// ie
           window.external.AddFavorite(url, title);
       }
       ```
   
 * And here’s the link code:
    `<?php echo sprintf(__("<a href=\"javascript:bookmark_us('
   http://www.carnavalhearstcarnival.com','Carnaval de Hearst Carnival')\">Bookmark
   our site!</a>"), __("Bookmark our site!")); ?>`
 *  Thread Starter [theresel](https://wordpress.org/support/users/theresel/)
 * (@theresel)
 * [16 years, 4 months ago](https://wordpress.org/support/topic/bookmark-us-script/#post-1374690)
 * Anyone??
 *  [fuzzie](https://wordpress.org/support/users/fuzzie/)
 * (@fuzzie)
 * [15 years, 9 months ago](https://wordpress.org/support/topic/bookmark-us-script/#post-1374768)
 * did you figure this out?

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Bookmark Us Script’ is closed to new replies.

## Tags

 * [javascript](https://wordpress.org/support/topic-tag/javascript/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 3 replies
 * 2 participants
 * Last reply from: [fuzzie](https://wordpress.org/support/users/fuzzie/)
 * Last activity: [15 years, 9 months ago](https://wordpress.org/support/topic/bookmark-us-script/#post-1374768)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
