Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bookmarklet In New Window

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'); })();
like image 363
Me1000 Avatar asked Apr 05 '09 22:04

Me1000


People also ask

What is the bookmarklet button?

Bookmarklets are browser bookmarks that execute JavaScript instead of opening a webpage. They're also known as bookmark applets, favlets, or JavaScript bookmarks. Bookmarklets are natively available in all major browsers, including Mozilla Firefox and Chromium-based browsers like Chrome or Brave.

Do bookmarklets still work?

The bookmarklet concept appeared in Netscape's JavaScript guide in 1998, explaining how to use JavaScript code snippets to do things that the browser did not offer from the different menus. In 2021, current browsers and extensions already implement most of those functions, but they are still helpful.


1 Answers

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');
like image 180
Joel Avatar answered Sep 20 '22 18:09

Joel