Where did you install Firefox from? Help Mozilla uncover 3rd party websites that offer problematic Firefox installation by taking part in our campaign. There will be swag, and you'll be featured in our blog if you manage to report at least 10 valid reports!

Sykje yn Support

Mij stipescams. Wy sille jo nea freegje in telefoannûmer te beljen, der in sms nei ta te stjoeren of persoanlike gegevens te dielen. Meld fertochte aktiviteit mei de opsje ‘Misbrûk melde’.

Learn More

Dizze konversaasje is argivearre. Stel in nije fraach as jo help nedich hawwe.

in JS, how to save a bookmark which can open in main, not sidebar?

  • 2 antwurd
  • 11 hawwe dit probleem
  • 9 werjeftes
  • Lêste antwurd fan cor-el

more options

I did lots of search on the web. People have been struggling with this problem for many years.

The scenario:

My standard_weight.php takes height parameter either from $_GET or from $POST. The web page has a form to let users type in height.

Control-D can save the location, but not the height.

My page is too simple to ask users to create an account and save profile.

So I want to provide a link users can click and bookmark the current page with height.

<script language="JavaScript1.2" type="text/javascript">
 function CreateBookmarkLink() {

 title = "my ideal weight"; 
 height = function_to_get_current_height_value();
 url = "http://my.site.com/standard_weight.php?height=" + height ;

	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
		alert("Sorry, your browser doesn't support this function." );
	}
	return false ; 
 }

 if (window.external) {
  document.write('<a onClick ="javascript:CreateBookmarkLink();">Add to Favorites</a>'); 
  } else  if (window.sidebar) {
  document.write('<a onClick ="javascript:CreateBookmarkLink();">Bookmark Page</a>'); 
 } else if (window.opera && window.print) {	
   document.write('<a onClick ="javascript:CreateBookmarkLink();">Add Bookmark</a>');
 } 
</script>


When the link is clicked , a dialog will pop up and the user can save the bookmark.

The problem is that when the bookmark is opened, it is in sidebar. The bookmark property has the check for "Load this bookmark in the sidebar." Asking users to clear the check is not a friendly solution.

Is there anyway to get around this problem?

If you google this topic, you can find that people has been struggling with this for long time. I guess that they just end up with saying "sorry, your browser doesn't support this function." on Firefox.


Best wishes to Firefox !

I did lots of search on the web. People have been struggling with this problem for many years. The scenario: My standard_weight.php takes height parameter either from $_GET or from $POST. The web page has a form to let users type in height. Control-D can save the location, but not the height. My page is too simple to ask users to create an account and save profile. So I want to provide a link users can click and bookmark the current page with height. <pre><nowiki><script language="JavaScript1.2" type="text/javascript"> function CreateBookmarkLink() { title = "my ideal weight"; height = function_to_get_current_height_value(); url = "http://my.site.com/standard_weight.php?height=" + height ; 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 alert("Sorry, your browser doesn't support this function." ); } return false ; } if (window.external) { document.write('<a onClick ="javascript:CreateBookmarkLink();">Add to Favorites</a>'); } else if (window.sidebar) { document.write('<a onClick ="javascript:CreateBookmarkLink();">Bookmark Page</a>'); } else if (window.opera && window.print) { document.write('<a onClick ="javascript:CreateBookmarkLink();">Add Bookmark</a>'); } </script> </nowiki></pre> When the link is clicked , a dialog will pop up and the user can save the bookmark. The problem is that when the bookmark is opened, it is in sidebar. The bookmark property has the check for "Load this bookmark in the sidebar." Asking users to clear the check is not a friendly solution. Is there anyway to get around this problem? If you google this topic, you can find that people has been struggling with this for long time. I guess that they just end up with saying "sorry, your browser doesn't support this function." on Firefox. Best wishes to Firefox !

Bewurke troch cor-el op

Alle antwurden (2)

more options

There are two Bugs related to a feature like that; one was WONTFIX'd and the other is still open.
https://bugzilla.mozilla.org/show_bug.cgi?id=66248
https://bugzilla.mozilla.org/show_bug.cgi?id=214530

(Please don't comment in that Bug report unless you can provide a patch to fix the problem.) https://bugzilla.mozilla.org/page.cgi?id=etiquette.html

more options

It would be better to ask Firefox users to press Ctrl + D to bookmark the current link.