Jump to content

add bookmark Firefox


Obi1-Cannabis

Recommended Posts

hi,i have this function in javascript to add bookmarks in any browser (or so i think...) it's working ok, though i just tested it with ie7 and firefox 2. The problem in Firefox is that when i open the saved bookmark it opens on side pannel :) here is the function:

function Favoritos(){ var title="Page Name" var url="http://www.domain.com"		 if (window.sidebar){    window.sidebar.addPanel(title, url,""); }			 else if( window.opera && window.print ){   var mbm = document.createElement('a');   mbm.setAttribute('rel','sidebar');   mbm.setAttribute('href',url);   mbm.setAttribute('title',title);   mbm.click();}			else if( window.external ){   window.external.AddFavorite( url, title);	}}

if anyone nows how to make it to open how it is suposed please let me know. Also you can try it whith opera and netscape and tell me if it works.

Link to comment
Share on other sites

by the way, why doesn't this work in firefox?

function clearOptions(selectId) {   for (i=document.getElementById(selectId).options.length;i>=0;i--)   document.getElementById(selectId).options.remove(i); }

Edit1:Solved this one. my solution for anyone interested:

function clearOptions(selectId) {   for (i=document.getElementById(selectId).options.length;i>=0;i--)	 if(window.opera || window.print || window.sidebar){	   document.getElementById(selectId).options[i] = null;	 }else if (window.external){	   document.getElementById(selectId).options.remove(i); }

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...