Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

javascript bookmark / favorite issue.

Status
Not open for further replies.

deluxmilkman

Programmer
Sep 26, 2007
17
0
0
JP
I'm trying to make a book mark button the following is what I have.
It shows the alert, but bookmark nothing.
(I'm using Mac.)


HTML:
function bookmark(title, url){
if ((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion) >= 4)) {

window.external.AddFavorite(url,title);
alert("IE: bookmarked");
}
else if(navigator.appName == "Netscape"){
alert("NETSCAPE: NOT SUPPORTED");
}else{
alert("NOT SUPPORTED");
	}
}


 <a href="javascript:bookmark('My title','My url');">Click to Bookmark</a>
When I use the following in function, nothing happens.


if (window.sidebar) {
window.sidebar.addPanel(title, url);
} else if( window.external ) {
window.external.AddFavorite( url, title);
}

Can you help me?
 
It shows the alert, but bookmark nothing.
What alert. You have 3 alerts in your code.

When I use the following in function, nothing happens.
What browsers (and specifically, what version: 1.5?, 2?, 3?, 5? 5.5? 6? 7?) are you finding this behaviour with?

Cheers,
Jeff

[tt]Jeff's Blog [!]@[/!] CodeRambler
[/tt]

Make sure your web page and css validates properly against the doctype you have chosen - before you attempt to debug a problem!

FAQ216-6094
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top