Bookmark that works in IE & Firefox

Watch

mr-x

Account Closed (Requested)
Impact
46,458
This simple script will create a link that adds the current page to the users bookmark or favorites folder in IE & Firefox

Code:
<script language="JavaScript1.2" type="text/javascript">
    function addBookmark(title,url) {
        if (window.sidebar) {
            window.sidebar.addPanel(title, url,"");
        } else if( document.all ) {
            window.external.AddFavorite( url, title);
        } else if( window.opera && window.print ) {
            return true;
        }
    }
</script>


<a href="javascript:void(addBookmark(document.title, window.location.href));">Bookmark Us</a>
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
Nice little script there. That could be very useful.
 
0
•••
yes, when i get my site up another code i will use :)
 
0
•••
J_Ronaldo_19 said:
yes, when i get my site up another code i will use :)
Me too! :D
Did you make this or find it on a site???
 
0
•••
i think he would of made it it looks quite simple :)
 
0
•••
I tested it on my site and it works!! Used it together with PHP as well, fantastic.

Took just a little time to figure out that I had to remove "title,url" in "function addBookmark(title,url)" and replaced then all other occurances of title and url with PHP.

Thanks a lot.
 
0
•••
Nice code you got there, thanks for sharing:)
 
0
•••
0
•••
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back