views:

363

answers:

1

So I've got a bookmarklet which should open up a page in a new window.

javascript:window.open('http://timetableapp.com/TimeTable/bookmarklet/index.html','TimeTable%20Timer','status=no,directories=no,location=no,resizable=no,menubar=no,width=400,height=210,toolbar=no');

The code works perfectly in Safari, Firefox, and Chrome; but as expected IE (7 and 8) is causing problems. IE gives me a useless error when I open the bookmarklet, and no window opens.

I've tried to editing the bookmarklet so that it appends the page with a script tag. Then inside the script tag the window.open() code is added, or it accesses the script (which contains the window.open() ) [I've tried it both ways]

I'm at a loss now.

Anyone have any idea how to get the page to popup in IE (preferably with code that works in Safari, FF, and Chrome too)?

Thanks,

EDIT: The final code I ended up with:

javascript:(function(){ window.open('http://timetableapp.com/TimeTable/bookmarklet/index.html','TimeTableTimer','status=no,directories=no,location=no,resizable=no,menubar=no,width=400,height=210,toolbar=no'); })();
+2  A: 

You can't have %20 or spaces in your window name. The name is for referring to the window again later in code.

Try:

javascript:window.open('http://timetableapp.com/TimeTable/bookmarklet/index.html','TimeTableTimer','status=no,directories=no,location=no,resizable=no,menubar=no,width=400,height=210,toolbar=no');
Joel Potter
Thank you! I had to wrap it in a self-calling anonymous function otherwise IE and Firefox redirected the current page, but other than that everything works! You were a huge help! Thanks!
Me1000