我从JQuery.noConflict()
文档中获得了以下代码
<script type="text/javascript" src="other_lib.js"></script>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript">
$.noConflict();
jQuery(document).ready(function($) {
// Code that uses jQuery's $ can follow here.
});
// Code that uses other library's $ can follow here.
</script>
正如我们所见,ready
方法回调函数接受一个参数,但我们在哪里传递这个参数?