Need Help with Bookmark Code

Discussion in 'JavaScript' started by jbperkins, Mar 7, 2008.

  1. #1
    Hi,

    I stole a "bookmark this page" code from a website because it seems to work with IE and Mozilla (and I'm an idiot and don't know how to do it myself).

    The problem is it opens the bookmarked page into a little sidebar window.

    How do I change the code below, so that it will just open the page into a regular full page window? Thanks for any help.


    <script type="text/javascript">
    function bookmark(){
    var pgUrl = window.location.href;
    var pgTitle = document.title;
    if (window.sidebar) {
    window.sidebar.addPanel(pgTitle, pgUrl,"");
    } else if( document.all ) {
    window.external.AddFavorite( pgUrl, pgTitle);
    } else if( window.opera && window.print ) {
    var elem = document.createElement('a');
    elem.setAttribute('href',pgUrl);
    elem.setAttribute('title',pgTitle);
    elem.setAttribute('rel','sidebar');
    elem.click();
    }
    }
    </script>
     
    jbperkins, Mar 7, 2008 IP
  2. glitto

    glitto Notable Member

    Messages:
    2,839
    Likes Received:
    185
    Best Answers:
    0
    Trophy Points:
    205