我有一个wordpress,我有各种脚本。
我已将jquery和jquery ui排在标题中
wp_enqueue_script('jquery', 'https://cdnjs.cloudflare.com/ajax/libs/jquery/1.12.4/jquery.min.js', null, null, false);
wp_enqueue_script('jquery-ui', 'https://code.jquery.com/ui/1.10.0/jquery-ui.min.js', null, null, false);
wp_enqueue_script('scripts', 'https://eg1234.cloudfront.net/wp-content/scripts/scripts.js', ['jquery','jquery-ui'], '', true);
我还有defer scripts函数,它添加了
defer="defer" onload src="..."
但是我犯了个错误
Uncaught TypeError: $(...).accordion is not a function
这在我的脚本文件中,依赖于jquery ui,我相信defer脚本在加载jqueryui之后?
有什么帮助吗?