admin管理员组文章数量:1131440
I am working on creating a plugin. The first thing I do is enqueue my css and javascript files. If I view the page source, I am seeing both files loaded. The problem I am having, is I have some functions in the javascript file that won't load. I believe the issue is that the javascript file is loaded before the plugin content. This is probably really easy, but how do I force the javascript file to reload after my plugin content is loaded, or to be the last thing loaded?
I am working on creating a plugin. The first thing I do is enqueue my css and javascript files. If I view the page source, I am seeing both files loaded. The problem I am having, is I have some functions in the javascript file that won't load. I believe the issue is that the javascript file is loaded before the plugin content. This is probably really easy, but how do I force the javascript file to reload after my plugin content is loaded, or to be the last thing loaded?
Share Improve this question asked Oct 30, 2023 at 17:28 Darth Mikey DDarth Mikey D 931 silver badge9 bronze badges1 Answer
Reset to default 0Use a construct like this one:
(function( $ ) {
'use strict';
$( document ).ready( function() {
// Put your code here
});
})( jQuery );
本文标签: Javascript functions not running
版权声明:本文标题:Javascript functions not running 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736763025a1951659.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论