jQuery没有注册$

Ale*_*art 0 javascript jquery

我在网站上使用原型+ jquery.现在原型插件使用$.我不希望jQuery使用$.如何让jQuery不注册$.另外,我如何调用jQuery函数.

感谢您的时间.

Mar*_*ang 16

jQuery 文档中有一篇文章介绍如何使jQuery与其他库一起使用.

这是该文章的一种建议方式:

<html>
<head>
  <script src="prototype.js"></script>
  <script src="jquery.js"></script>
  <script>
    jQuery.noConflict();

    // Put all your code in your document ready area
    jQuery(document).ready(function($){
      // Do jQuery stuff using $
      $("div").hide();
    });

    // Use Prototype with $(...), etc.
    $('someid').hide();
  </script>
</head>
<body></body>
</html>
Run Code Online (Sandbox Code Playgroud)