Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

javascript to call "Add to favourites"

0 views
Skip to first unread message

Simon Wigzell

unread,
Aug 22, 2003, 11:55:22 AM8/22/03
to
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!


steve stevo

unread,
Aug 23, 2003, 5:29:01 AM8/23/03
to
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" <simonw...@shaw.ca> wrote in message
news:K1r1b.804527$ro6.16...@news2.calgary.shaw.ca...

HikksNotAtHome

unread,
Aug 24, 2003, 2:56:16 AM8/24/03
to
>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.

0 new messages