<A HREF="javascript:window.external.Addfavorite('http://www.yahoo.co.uk/',
'Yahoo Home Page')" >Add to Favourites</A>
"Simon Wigzell" <simonw...@shaw.ca> wrote in message
news:K1r1b.804527$ro6.16...@news2.calgary.shaw.ca...
><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.