admin管理员组文章数量:1399737
So I've got a bookmarklet which should open up a page in a new window.
javascript:window.open('.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('.html','TimeTableTimer','status=no,directories=no,location=no,resizable=no,menubar=no,width=400,height=210,toolbar=no'); })();
So I've got a bookmarklet which should open up a page in a new window.
javascript:window.open('http://timetableapp./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./TimeTable/bookmarklet/index.html','TimeTableTimer','status=no,directories=no,location=no,resizable=no,menubar=no,width=400,height=210,toolbar=no'); })();
Share
Improve this question
edited Apr 5, 2009 at 22:34
Me1000
asked Apr 5, 2009 at 22:14
Me1000Me1000
1,7581 gold badge12 silver badges14 bronze badges
1 Answer
Reset to default 7You 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./TimeTable/bookmarklet/index.html','TimeTableTimer','status=no,directories=no,location=no,resizable=no,menubar=no,width=400,height=210,toolbar=no');
本文标签: javascriptBookmarklet In New WindowStack Overflow
版权声明:本文标题:javascript - Bookmarklet In New Window - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744150962a2593054.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论