- //方法1
- if (jQuery) {
- // jQuery is loaded
- } else {
- // jQuery is not loaded
- }
- //方法2
- if (typeof jQuery == 'undefined') {
- // jQuery is not loaded
- } else {
- // jQuery is loaded
- }
- //该片段来自于http://www.codesnippet.cn/detail/020520133106.html
来源: http://www.codesnippet.cn/detail/020520133106.html