jQuery多库共存


DOCTYPE html>
<html>
<head>
  <meta charset="UTF-8">
  <title>26_多库共存title>
  <style type="text/css">
    * {
      margin: 0px;
    }

    .div1 {
      position: absolute;
      width: 100px;
      height: 100px;
      top: 50px;
      left: 10px;
      background: red;
    }
  style>
head>
<body>

<script type="text/javascript" src="js/myLib.js">script>
<script type="text/javascript" src="js/jquery-1.10.1.js">script>
<script type="text/javascript">

  // 释放$的使用权
  jQuery.noConflict()
  // 下面的写法就是调用myLib中的$了
  $()
  // 要想使用jQuery的功能, 只能使用jQuery
  jQuery(function () {
    console.log('文档加载完成')
  })
  console.log('+++++')

script>
body>
html>