我看到Wordpress在jquery中加载的每一页上,我该如何使用jquery,因为它一直告诉我它无法识别$
或$noConflict();
- 我正在尝试在下面添加一些jquerywp_head()
.
Use Wordpress Built In Jquery
1 个回复
最合适的回答,由SO网友:Milo 整理而成
jQuery对象是jQuery
而不是$
. 看见noConflict wrappers in wp_enqueue_script
对于一些示例。
jQuery(document).ready(function($) {
// Inside of this function, $() will work as an alias for jQuery()
// and other libraries also using $ will not be accessible under this shortcut
});
结束