Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Add to Favorites with Image

Posted on 2011-09-06
5
Medium Priority
?
285 Views
Last Modified: 2012-05-12
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
0
Comment
Question by:correlate
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 17

Accepted Solution

by:
OmniUnlimited earned 2000 total points
ID: 36488264
Try this:
 
<img src="/SiteAssets/SitePages/FileFinder2/favourites.png" alt="Add to Favorites" onClick='window.external.AddFavorite("http://www.bbc.co.uk/", "BBC");' style="cursor: pointer">

Open in new window

0
 

Author Comment

by:correlate
ID: 36488654
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
0
 
LVL 17

Expert Comment

by:OmniUnlimited
ID: 36488749
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.
0
 

Author Closing Comment

by:correlate
ID: 36488851
Thank you so much for this - works all fine (I failed to copy the entire code, hence the struggle to get it to work)
0
 
LVL 17

Expert Comment

by:OmniUnlimited
ID: 36493433
No problem.  I'm glad you got it up and running!
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
In this Micro Tutorial viewers will learn how to create navigation buttons that change on rollover, using CSS (Continuation of the CSS Image Sprite tutorial) Create a parent ID for all the list items       - Specify position: absolute and display: block…
In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…

670 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question