HTML Bookmarklet模板:将任何JavaScript代码片段转换为Bookmarklet

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了HTML Bookmarklet模板:将任何JavaScript代码片段转换为Bookmarklet相关的知识,希望对你有一定的参考价值。

<!-- Replace alert('hi'); with your own JavaScript. -->

<a href="javascript:alert('hi');void 0;">Hello</a>

<!-- For code that is likely to throw errors, wrap the body of the bookmarklet in a try/catch block: -->

<a href="javascript:try{doSomething()}catch(e){};void 0;">What could go wrogn?</a>

JavaScript Sqworl Bookmarklet

javascript:(function(){sqworl_script=document.createElement('SCRIPT');sqworl_script.type='text/javascript';sqworl_script.src='http://sqworl.com/bookmarklet/bml.js?x='+(Math.random());document.getElementsByTagName('head')[0].appendChild(sqworl_script);})();

以上是关于HTML Bookmarklet模板:将任何JavaScript代码片段转换为Bookmarklet的主要内容,如果未能解决你的问题,请参考以下文章

html PrismJS Bookmarklet示例

HTML Ventriloquist Bookmarklet

javascript Bookmarklet:清除YouTube中的视频

javascript Bookmarklet:批量取消订阅YouTube频道

jQuery Bookmarklet

JavaScript del.icio.us Bookmarklet