View Full Version : Google Calendar Window Open Bookmark

11-06-2006, 02:22 PM
I've made a script for a bookmarklet to open Google Calendar in a toolbarless popup window to save screenspace.

This is what I've got:

javascript:window.open('http://www.google.com/calendar/render?pli=1','Google Calendar','width=screen.width,height=screen.height,top=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100,left=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100,scrollbars=no,location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=yes')

However, after clicking on it (the popup window works fine), the active tab/window changes to a page with address of the javascript and content "[object Window]". I know its possible to stop it doing this with something like
return false; but it seems to stop the script from running.

Anyone have any ideas?


11-06-2006, 07:03 PM
Try it with:

javascript:void( code here )

That should stop the problem you are having and, as long as it is valid code otherwise, it will do what you want it to do.

Returning false is for events that have a default return behavior that you want to avoid, like clicking on a link will switch to the href, selecting text will highlight it and make it available for copying. As far as I know, a bookmarklet has no default return anyway.

11-07-2006, 02:55 AM
That seemed to work, thanks!