gpt4 book ai didi

jquery - PhpStorm jQuery.noConflict() css 完成不起作用

转载 作者:行者123 更新时间:2023-12-01 08:43:28 24 4
gpt4 key购买 nike

$('#') // hint a list of id
var j = jQuery.noConflict()
j('#') // no hint
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>

在评论中使用上下文

最佳答案

<!-- Putting jQuery into no-conflict mode. -->
<script src="prototype.js"></script>
<script src="jquery.js"></script>
<script>

var $j = jQuery.noConflict();
// $j is now an alias to the jQuery function; creating the new alias is optional.

$j(document).ready(function() {
$j( "div" ).hide();
});

// The $ variable now has the prototype meaning, which is a shortcut for
// document.getElementById(). mainDiv below is a DOM element, not a jQuery object.
window.onload = function() {
var mainDiv = $( "main" );
}

</script>

关于jquery - PhpStorm jQuery.noConflict() css 完成不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44469388/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com