PDA

View Full Version : adding a book mark



bluerovers
09-01-2007, 09:10 AM
hey all

im trying too add a bookmark me button on my page and fell i am lost

i downloaded the following code from a website

bookmark(address,sitename) {
if (window.sidebar) {
window.sidebar.addPanel(sitename, address,"");
} else if( document.all ) {
window.external.AddFavorite(address, sitename);
} else if( window.opera && window.print ) {
return true;
}
}

it also says to place this in the html header

script type="text/javascript" src="addToFavorites.js"></script>

and this in the body

<a href="#" onclick="bookmark('http://javascript.internet.com/','JavaScript Source')">Bookmark our site!</a>

i know it sounds bumb but not overly sure how to do this?

thanks

bluerovers
www.bluerovers.co.nz (http://www.bluerovers.co.nz)

Collectors-info
09-01-2007, 10:12 AM
1st part.
Click on View>Page Html>Between the head, & enter this part of the code.

<script type="text/javascript" src="addToFavorites.js"></script>

2nd part
Click & open the scripts button. & d/click on the script box to open. Check the radio button Java script. And enter code below.

/* This script and many more are available free online at
The JavaScript Source!! http://javascript.internet.com
Created by:http://www.webbiesite.com */
function bookmark(address,sitename) {
if (window.sidebar) {
window.sidebar.addPanel(sitename, address,"");
} else if( document.all ) {
window.external.AddFavorite(address, sitename);
} else if( window.opera && window.print ) {
return true;
}
}


Part 3.
Click on html box & d/click to open html properties. Enter this code.

<a href="#" onclick="bookmark('http://javascript.internet.com/','JavaScript Source')">Bookmark our site!</a>


Press preview to test.


Good luck.
PS, You will only see the Bookmark this site text.

calvinngsc
09-01-2007, 02:02 PM
Hi Chris,

Your above step really helps.

Thanks

Calvin

Collectors-info
09-01-2007, 02:04 PM
Pleasure!

bluerovers
09-02-2007, 07:45 AM
collector..........you rock cheers buddy

bluerovers
www.bluerovers.co.nz

bluerovers
09-12-2007, 10:57 AM
hi as ive said, the help you get from people on this forum is first class! so i'd just like to trouble you good people again. with the above code could anyone tell me how to change thew colour of 'bookmark this site' as it is blue and i wouldn't mid a different colour

thanks in advance

bluerovers
www.bluerovers.co.nz

Collectors-info
09-12-2007, 11:39 AM
Hi, try this.

<a href="#" onclick="bookmark('http://javascript.internet.com/','JavaScript Source')"><font color="green">Bookmark our site!</font></a>

You can change the green part to a #000000 style if you want.

noritauhidi
11-13-2007, 02:03 PM
Hey this worked excellent for my site on internet explorer. However when I try to use it in mozilla firefox, I can save the bookmark but when I open it, it opens it in the side bar instead of the main part of the browser. Any suggestions? I'd greatly appreciate it, I've been trying to fix this for hours.