Google 網路論壇不再支援新的 Usenet 貼文或訂閱項目,但過往內容仍可供查看。

javascript to call "Add to favourites"

瀏覽次數:0 次
跳到第一則未讀訊息

Simon Wigzell

未讀,
2003年8月22日 上午11:55:222003/8/22
收件者:
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

未讀,
2003年8月23日 清晨5:29:012003/8/23
收件者:
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

未讀,
2003年8月24日 凌晨2:56:162003/8/24
收件者:
>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 則新訊息