By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,600 Members | 1,861 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,600 IT Pros & Developers. It's quick & easy.

addFavorite method

P: n/a
Hi,
I need some help adding a redirected page to the favorites. Thanks to
the help from this user group, I was able to finish a redirect script.
I was wondering if anybody knew of a method that will allow one to do
a check in the user's browser's (IE) favorites to see if a bookmark is
already present. This is what I am trying to accomplish:

if (window.external.checkFavorite(location.href, document.title))
do nothing
else {
alert("Please update your bookmark.");
window.external.addFavorite(location.href, document.title))
alert("Thank you for update your bookmark. We hope you will enjoy the
new site!");
}

And this gets called in the redirect script.
The idea is that if a user is trying to access an old page from a
bookmark, not only am I redirecting them but also giving them the
opportunity or prompting them to update thier bookmarks. But this
process should happen only once. That is, when the user revisits that
bookmark, the bookmark is of course the updated new url so he wouldn't
be seeing that again.

Also, where can I get access to the Javascript API...something like
javadocs for the methods, etc.

Thanks,
Slash
Jul 20 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
In article <30**************************@posting.google.com >, sa*****@gwu.edu
(slash) writes:
Hi,
I need some help adding a redirected page to the favorites. Thanks to
the help from this user group, I was able to finish a redirect script.
I was wondering if anybody knew of a method that will allow one to do
a check in the user's browser's (IE) favorites to see if a bookmark is
already present. This is what I am trying to accomplish:

if (window.external.checkFavorite(location.href, document.title))
do nothing
else {
alert("Please update your bookmark.");
window.external.addFavorite(location.href, document.title))
alert("Thank you for update your bookmark. We hope you will enjoy the
new site!");
}
the only thing you can test for is:

if (window.external)

Any further tests throw errors, in browsers that support it.
When providing the JS solution to adding a Favorite, you should be checking for
it though (object detection):

if (window.external){
//try to use window.external.addFavorite()
}

And this gets called in the redirect script.
The idea is that if a user is trying to access an old page from a
bookmark, not only am I redirecting them but also giving them the
opportunity or prompting them to update thier bookmarks. But this
process should happen only once. That is, when the user revisits that
bookmark, the bookmark is of course the updated new url so he wouldn't
be seeing that again.
Keep a temporary page at the old bookmark, that redirects after X seconds, with
a statement "If you have this page bookmarked, please bookmark the new page you
are being redirected to".

If the site is worth having as a fav, when told that its being redirected, I
will update Favorites accordingly.

JS has no way of checking if a Fav exists or not. In fact, there is no
foolproof way to even check to make sure .addFavorite() will work (Its been
discussed and tried before now, to no avail).
Also, where can I get access to the Javascript API...something like
javadocs for the methods, etc.


<URL:
http://msdn.microsoft.com/library/de...n-us/script56/
html/js56jsoriversioninformation.asp />

Is the MS documentation, although its not a true complete list.

--
Randy
Jul 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.