Javascript – Crear un Bookmark

Author: Adrià Cidre  |  Category: Java Script

Bueno como no podia ser de otra manera, Firefox, IE y Opera se lo montan diferente a la hora de gestionar los bookmarks, por lo que será necesario la siguiente función para poder crear un enlace que nos permita añadir un bookmark en cualquiera de los tres navegadores anteriores.


function CreateBookmarkLink(title, url) {
	if (window.sidebar) { // Mozilla Firefox Bookmark
		window.sidebar.addPanel(title, url,"");
	} else if( window.external ) { // IE Favorite
		window.external.AddFavorite( url, title); }
	else if(window.opera && window.print) { // Opera Hotlist
		return true; }
 }

Tags: , , , , ,

2 Responses to “Javascript – Crear un Bookmark”

  1. www.pixel-gd.net Says:

    How work with button?

  2. Adrià Cidre Says:

    Well, I think that if you call this function from the inside of the onclick event, everything should work perfectly, isn’t it?

Leave a Reply