Opened 12 years ago
Closed 12 years ago
#20976 closed defect (bug) (duplicate)
jQuery loading last
Reported by: | sccr410 | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | critical | Version: | 3.4 |
Component: | General | Keywords: | |
Focuses: | Cc: |
Description
After upgrading to 3.4, every piece of JavaScript on my site no longer worked. I was getting "jQuery not defined" errors. Looked into source code and now for some reason jQuery is the last of all enqueue'd scripts to be loaded. This means every plugin that loads JS and needs jQuery doesn't have it available when it is initially loaded. Something happened in this latest release because this has never been an issue before.
I can't upgrade any of my WP sites otherwise I have to redo the theme to manually insert jQuery which is not idea - want to use enqueue to make sure it doesn't get loaded twice.
Change History (7)
#3
@
12 years ago
Am I doing something wrong in my themes using wp_enqueue_script('jquery') and then wp_head() (because I need jQuery for my theme) or is it the plugin developers that are doing things wrong? Just want to make sure I am doing things right for future releases of WP!
#4
@
12 years ago
- Cc George@… added
Out of curiosity, do you have jQuery set as a dependency for your other scripts that need it?
#5
@
12 years ago
It is JavaScript from plugins, so I don't have control over that. While plugin authors should be doing this, it appears not many do. So I don't know if this would be considered a bug or 90% of plugins need to be updated to set jQuery as a dependency.
Related: #20971