1<script type="text/javascript"> 2javascript : void (function(version) { 3 var scriptTag = document.createElement('script'); 4 scriptTag.type = 'text/javascript'; 5 scriptTag.src = 'http://code.jquery.com/jquery-' + version + '.min.js'; 6 alert(scriptTag.src); 7}('1.6.4')); 8</script>
书签栏工具就是用这个方法实现的。
来源于:https://github.com/brian-c/phantom-limb/blob/master/bookmarklet.js