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

javascript to call "Add to favourites"

P: n/a
What is the call? Better yet is there a link to a page that describes all
the possible javascript calls to the various browser menu items and explains
compatibility across different browsers? Thanks!
Jul 20 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
You cannot get javascript to automatically add to favourite, choose home
page etc, the surfer will always be warned.

<A HREF="javascript:window.external.Addfavorite('http ://www.yahoo.co.uk/',
'Yahoo Home Page')" >Add to Favourites</A>

"Simon Wigzell" <si**********@shaw.ca> wrote in message
news:K1***********************@news2.calgary.shaw. ca...
What is the call? Better yet is there a link to a page that describes all
the possible javascript calls to the various browser menu items and explains compatibility across different browsers? Thanks!

Jul 20 '05 #2

P: n/a
>You cannot get javascript to automatically add to favourite, choose home
page etc, the surfer will always be warned. <A HREF="javascript:window.external.Addfavorite('http ://www.yahoo.co.uk/',
'Yahoo Home Page')" >Add to Favourites</A>


1) See the FAQ with regards to the use of javascript:
http://jibbering.com/faq/#FAQ4_24

2) With the aforementioned problem fixed, it still fails in any browser that
doesn't support window.external.Addfavorite. Its an IE-only thing, and even
that is not completely true.

Before using a feature, test for it:

<input type="button" onclick="addToFavorites()" value="Add To Favorites" />

function addToFavorites(){
if (window.external){
window.external.Addfavorite('http://www.yahoo.co.uk/','Yahoo Home Page')
}
else{
alert('You are using a browser that does not support adding Favorites by
script, please add it manually');
}
}

I say not all IE's because the AOL client software (PC version) uses IE as a
shell browser, but it doesn't support the Addfavorite.

There is no code that will add a site to my favorites in AOL.

Three ways to add Favorites in AOL:

1) Right Click>Add To Favorites works but the window.external.AddFavorite
doesn't work with AOL.
2)Click the heart that AOL adds to the upper right corner of the browser window
and that action isn't scriptable.
Even if you could script clicking that heart, clicking it brings up another
window that has a menu on it that has to be clicked, to show yet another menu,
before you actually have saved it to favorites.
3) Drag the heart to the favorites folder and drop it.

That is for the PC version of AOL. The MAC versions may act differently.

So testing for IE features, short of the actual Addfavorite, will fail.
--
Randy
All code posted is dependent upon the viewing browser
supporting the methods called, and Javascript being enabled.
Jul 20 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.