jQuery的引入

要使用jquery就要先引入jquery。

目前通过查看网页源代码的方式,发现主流网站都用的时jQuery1.0版本。

如果引入jQuery

<script src="jq/jquery-1.12.4.js"></script>

如果在<script>和</script>之间,再写其它代码,如果下面的例子,则这些代码不会被执行。

这是通过试验得出的。

<script src="jq/jquery-1.12.4.js">
  $(document).ready(function(){ 
  alert("hello"); //不会被执行
});
</script>
原文地址:https://www.cnblogs.com/majestyking/p/12628993.html