单击书签链接后打开弹出窗口 [英] open pop up after clicking bookmark link
问题描述
我正在处理一个简短的申请.在其中有后续内容.
I am working on a short application. In which I have followiing things.
- 将链接从我的页面移动到浏览器的书签工具栏-完成.
- 单击书签链接后,应打开弹出窗口.(用户可以在任何其他网站上).他将点击书签链接,然后弹出来打开-未完成
- 该弹出窗口应获取父窗口的标题,元数据,描述(用户当前打开的网站).--完成
很明显,我的问题是关于 2分.我不知道如何使此书签链接到绝对的CSS/JavaScript,以便它可以在任何网站上打开.
Obviously My question is about 2 Point. I cant figure out how to make this bookmark link to an absolute css/javascript so that it can open on any website.
推荐答案
您可以添加将JavaScript链接到网址,如下所示:
You can add javascript to URLs like so:
<a href="javascript:alert('hello');">Bookmarklet</a>
请注意,我在URL前面加上了 javascript:
,以指示浏览器应以javascript格式执行URL.
Note that I have prepended the URL with javascript:
to indicate the browser that it should execute the URL as javascript.
所以对于流行音乐,它就像:
So for a pop it would be something like:
<a href="javascript:window.open('http://www.example.org');">Bookmarklet</a>
此处是一个jsFiddle ,上面的代码供您测试.
Here is a jsFiddle with the code above for you to test.
有关小书签的更多信息,您可能喜欢以下文章: http://betterexplained.com/articles/how-to-make-a-bookmarklet-for-your-web-application/
For more information about bookmarklets you might like the following article: http://betterexplained.com/articles/how-to-make-a-bookmarklet-for-your-web-application/
这篇关于单击书签链接后打开弹出窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!