Jump to content
Sign in to follow this  
darknightelor

Adding "add to my favourites"!

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!

Share this post


Link to post
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.

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

Thanks,But it didn't actually work for me, not sure why. Maybe it's because it can't bookmark the page while it's in my computer's directory and not online yet. Nevertheless, I appreciate your help.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...