/    Sign up×
Community /Pin to ProfileBookmark

how to bookmark a link….

Hi,
I want to bookmark a link using javascript.
There is an func window.external.AddFavorite(url,title) for bookmarking a link in IE.
But i can’t find same facility for other browsers (i.e. mozilla, firefox, safari, netscape)
So if ne1 knows plz help me out…

to post a comment
JavaScript

5 Comments(s)

Copy linkTweet thisAlerts:
@KorJun 22.2006 — Moz uses window.sidebar.addPanel(). For Opera there is no method, as far as I know
[code=php]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta http-equiv="Content-Style-Type" content="text/css">
<meta http-equiv="Content-Script-Type" content="text/javascript">
<script type="text/javascript">
function CreateBookmarkLink() {
title = 'GOOGLE';
url = 'http://www.google.com';
if (window.sidebar) { // Mozilla Firefox Bookmark
window.sidebar.addPanel(title, url,"")
} else if( window.external ) { // IE Favorite
window.external.AddFavorite(url,title)
}
else if(window.opera && window.print) { // Opera Hotlist
return true;}
}
</script>
</head>
<body>
<a href="#" onclick="CreateBookmarkLink();return false">Add to Favorites</a>
</body>
</html>
[/code]
Copy linkTweet thisAlerts:
@swapnil_tailorauthorJun 22.2006 — Ok thanks.

[B]But it will just show the bookmark dialog box.[/B]

After that the user has to press yes/no to bookmark the page.

How can i come to know that user bookmarked that link or not? :eek:

Is there ne method or can i do such thing so that the dialogue box will not

appear and the link bookmarked directly w/o promting the user.
Copy linkTweet thisAlerts:
@KorJun 23.2006 — I doubt there is such a method. After all, as a user, I would like to keep full controll of my bookmark.
Copy linkTweet thisAlerts:
@felgallJun 23.2006 — For Mozilla, Firefox, Netscape, and Opera 9 there is CTRL-D

For earlier versions of Opera there is CTRL-T

The user has to press that key combination themselves - there is no Javascript to do it for them.
Copy linkTweet thisAlerts:
@KorJun 23.2006 — Ok thanks.

[B]But it will just show the bookmark dialog box.[/B]

After that the user has to press yes/no to bookmark the page.

How can i come to know that user bookmarked that link or not? :eek:

Is there ne method or can i do such thing so that the dialogue box will not

appear and the link bookmarked directly w/o promting the user.[/QUOTE]


Sir, I guess that 99.99% of the users who will click that link will bookmark it for sure, otherwise they would not have click it. You may count almost for sure each click on that link as a bookmarked link.
×

Success!

Help @swapnil_tailor spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.16,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...