使用jquery的时候,在开发进行之前如何检测jquery已经正确加载呢?
下面的方法是比较常用的方式:使用alert($);
<!doctype html> < html > < head > < meta charset = "utf-8" > < title > jquery test! </ title > < script src = "jquery.js" > < / script > < style type = "text/css" > * { margin : 0 ; padding : 0 ;} < / style > </ head > < body > < script > alert($); < / script > </ body > </ html >
运行之后如果弹出如图所示内容,即已经成功加载;