easier bookmarklet development

后端 未结 2 1394
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-28 10:24

Here\'s how I make develop a bookmarklet: I write a javascript function, pass that to Bookmarklet Builder to make a bookmarklet, add the bookmarklet to my browser, load my t

相关标签:
2条回答
  • 2020-12-28 11:21

    These days I prefer to edit a file on my webserver, then load that using a bookmarklet. For example:

    javascript:(function(){
        var newScript = document.createElement('script');
        newScript.src = 'http://hwi.ath.cx/javascript/wordcloud.js?dummy='
                         + Math.random();
        document.body.appendChild(newScript);
    })();
    

    The random parameter is useful for a script under development, to ensure the browser won't load an older version from its cache.

    I find development with a text editor far preferable to the console, because I can take advantage of syntax highlighting, shortcut keys, and — you know — newlines.

    0 讨论(0)
  • 2020-12-28 11:28

    use the firebug console to develop and test your function, and turn it into a bookmarklet once you've got it working like you want to.

    0 讨论(0)
提交回复
热议问题