Jump to content

Adding "add to my favourites"!


darknightelor
 Share

Recommended Posts

Hello all!I was wondering if there's a command to add to the page of "add to my favourites", which means, when a visitor will click it, the page will automatically be added to his favourites. I just wanna use it to make up for the usage of "Frames" which sometimes gives adding to favourites a hard time.If there's any explanation about this in W3schools, please link me to it, I couldn't find any.Thank you!

Link to comment
Share on other sites

I've never gotten much into that, but quick googling gives me a few individual browser codes. I'm not exactly sure if they work.Internet Explorer only: window.external.AddFavorite(url, title);Firefox only: window.sidebar.addPanel(title, url,"");I really don't recommend this for several reasons:

  • It's hardly compatible with any browsers.
  • If people want to add a page to their favourites they already know how to do it without help of your button.
  • It relies on Javascript, which will leave the user with a useless button on the page if its disabled.

Link to comment
Share on other sites

It's a script that uses the two methods I mentioned before with an extra part for Opera:

	var elem = document.createElement('a');	elem.setAttribute('href',url);	elem.setAttribute('title',title);	elem.setAttribute('rel','sidebar');	elem.click();

Apparently, it creates a link to the page, that has "sidebar" as the "rel" attribute, and then clicks on it.It's another browser specific feature.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...