将所有包含图像的链接更改为: javascript(alert(thehref));
将所有包含图像的链接更改为: javascript(alert(thehref));
例如。
<a href="/galleries/anna-leah-111827/image01.html"><img src="/source_galleries/anna-leah-111827/tn/01.jpg"></a>
<a href="/galleries/23435/image01.html">ssss</a>
变成
<a href="/galleries/anna-leah-111827/image01.html" onclick="alert(this.href)"><img src="/source_galleries/anna-leah-111827/tn/01.jpg"></a>
<a href="/galleries/23435/image01.html">ssss</a>
我怎样才能做到这一点作为使用外部 JavaScript 文件的书签。
我一整天都在尝试但没有成功。
Change all links that have an image in it to: javascript(alert(thehref));
eg.
<a href="/galleries/anna-leah-111827/image01.html"><img src="/source_galleries/anna-leah-111827/tn/01.jpg"></a>
<a href="/galleries/23435/image01.html">ssss</a>
becomes
<a href="/galleries/anna-leah-111827/image01.html" onclick="alert(this.href)"><img src="/source_galleries/anna-leah-111827/tn/01.jpg"></a>
<a href="/galleries/23435/image01.html">ssss</a>
How can I do that as a bookmarklet which uses an external JavaScript file.
I've been trying all day to no avail.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
编码到书签中:
encoded into a bookmarklet:
我将在外部文件中包含 jQuery,使用无冲突模式,并执行如下操作:
I would include jQuery in the external file, use noconflict mode, and do something like this: