Link to home
Start Free TrialLog in
Avatar of Tom Crowfoot
Tom CrowfootFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Add to Favorites with Image

Dear Experts,

I am trying to create an Add to Favourites icon (this adds a different URL to the current page as a favourite in internet explorer).  

Courtesy of EE I managed to do this as a button, but I really want to be able to have an image that gets clicked on to perform the task.

the code I am trying to use is this ...

<ahref="javascript:window.external.AddFavorite('http://www.bbc.co.uk','Text to use)"><img src="/SiteAssets/SitePages/FileFinder2/favourites.png""></a>

but it does nothing & also when I insert this into the HMTL editor it changes it.

Can anybody help
ASKER CERTIFIED SOLUTION
Avatar of OmniUnlimited
OmniUnlimited
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Tom Crowfoot

ASKER

Hi OmniUnlimited,

thanks for this, I'm getting in a muddle over this, I've tried putting the code in in various versions, but 9/10 the HTML editor converts it to this ...

<window.external.addfavorite('http:></window.external.addfavorite('http:>

Would you be able to post the full code, It's not being lazy, its just i cant get it to work and i am a novice at HTML coding

Many thanks

Tom
Hi Tom, I am more than happy to assist you, but you need to know that your HTML should not be changing the code (that would make it rediculously difficult to second guess the changes, wouldn't you say?).

I would recommend that you use a simple text editor like notepad to edit your html.  That way you can stick my code directly into the file just as it is.

I am not sure by what you mean by ,"Would you be able to post the full code", as the code I posted is fully self contained and would work if placed in an XHTML document between the <body></body> tags.

Let me know what it is exactly that you want me to do.
Thank you so much for this - works all fine (I failed to copy the entire code, hence the struggle to get it to work)
No problem.  I'm glad you got it up and running!