简体   繁体   English

书签javascript弹出麻烦

[英]Bookmarklet javascript popup trouble

Sorry to add to the burgeoning noise on bookmarklets. 抱歉,书签上的声音越来越大。 I'm having trouble figuring out the right approach and some trouble coding it. 我在找出正确的方法时遇到了麻烦,在编写代码时遇到了麻烦。

When the bookmarklet is activated, I want to 激活书签后,我要

1) Open a popup as about:blank 2) Then change the URL to my external web page which handles the functionality of the bookmarklet 3) And in the process pass parameters to that page in the GET request 1)打开一个关于about的弹出窗口:空白2)然后将URL更改为处理小书签功能的外部网页3)并在此过程中将参数传递给GET请求中的该页面

It should be easy right? 应该很容易吧? Then why does #1 insist opening a new tab in Chrome rather than a popup? 那么,为什么#1坚持要在Chrome中打开新标签页而不是弹出窗口?

<a href="javascript:(function(x) {var mypop=window.open('about:blank',config='height=200,width=400,toolbar=no,menubar=no,scrollbars=no,resizable=no,location=no,directories=no,status=no');})('hello world');" >Click</a>

What am I doing wrong? 我究竟做错了什么?

Thanks 谢谢

You forgot the second parameter to window.open() , so your config string is being interpreted as window name, not settings. 您忘记了window.open()的第二个参数,因此您的配置字符串被解释为窗口名称,而不是设置。 Use this: 用这个:

window.open('about:blank', '_blank', '... your parameters ...');

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM