前端 网页添加jquery、lodash等模块方法
- chrome书签栏
#网页添加jquery
javascript:(function(){script=document.createElement('script');script.src='https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js';document.body.appendChild(script);console.log($.fn.jquery);})();
#隐藏博客园博客的目录
javascript:(function(){document.getElementById("sideToolbar").style.display ='none';})();
http://www.ruanyifeng.com/blog/2011/06/a_guide_for_writing_bookmarklet.html
- 使用console-importer
https://github.com/pd4d10/console-importer
$i('lodash') #添加lodash
$i('jquery') #添加jquery
<script type="text/javascript">
_([1, 2]).forEach(function(value) {
console.log(value);
});
_.forEach([1, 3] , function(value, key) {
console.log(key,value);
});
</script>
'''
1
2
0 1
1 3
'''
_.forEach() 使用说明
https://www.jianshu.com/p/01f8b18ea2ae