If, as you have ensured, the javascript files are correctly loaded, simply WordPress is not likely to be involved in your problem.
That being said, if, as you also have ensured, the code is correct and there are no errors, I think that the problem can be related with the DOM being not ready. The code from java1.js code depends on DOM, so you must be sure that DOM is ready before you try to execute it. One of the easier and popular ways to do it is to wrap your code in jQuery(document).ready
method:
(function($){
// $ is locally scoped, so you can use it safely
// Your code that don't depends on DOM can go here
$(document).ready(function(){
// Your code that depends on DOM goes here
});
})(jQuery);
Related Posts:
- Apply jquery script to only woocommerce product pages and categories
- Enqueuing Script in functions.php vs on the page
- jquery won’t load in footer
- Replace menu links with # and add name to its li
- Loading CDN that requires jQuery in WordPress
- Scripts not appending to element in AJAX call – why?
- How to search using ajax for exact phrase or words in an input field?
- how to en-queue jQuery to load before the tag
- I can’t enqueue my scripts – They literally aren’t being added to my site
- Run a jquery script on on a certain template page
- Auto scroll to id on page load on all pages except home page. Only do this on mobile
- How to load jQuery in TOP of wp_footer?
- Include Jquery libraries in wordpress theme?
- Why a SlideShow (made using JQuery FlexSlider) can’t work if I load it form functions.php but work if I load it from my footer.php file? [closed]
- Creating multiple category drop down
- How to setup a popup registeration page in wordpress with function.php
- wp_set_object_term via js btn frontend
- How To Display Author Popup on Entry Meta (Genesis Framework)?
- Multiple Notifications SetInterval
- Automatic add space if user enters number(any digit)
- WordPress Javascript Widget jQuery Dependency Issue
- How do I get my nav menu to show sub pages?
- Animated Accordion [closed]
- iOS and ajaxComplete
- Does WordPress Development Mode Exist (with not minified JS)?
- AJAX handler throws 400 (Bad request) – why?
- Replacing select2 in admin backend for all selects
- How to use WordPress (PHP) functions in AngularJS partials files?
- Enqueuing External Javascript functions.php
- How to enqueue JavaScript for specific WordPress pages only?
- jQuery plugin function is not a function
- Properly applying nonce to a form using AJAX
- Unable to get_the_content(); of a post in WordPress via AJAX
- Add external js file to footer with id
- Ajaxing function in widget class
- How to load some jquery code to make validation in the theme customizer?
- Clean-up script tags
- Search user metadata with checkboxes via ajax (almost working)
- wp_enqueue JavaScript in child-theme (ReferenceError) using Search & Go
- Move jQuery and Migrate to footer?
- Why is my Gutenberg block returning an error after initial save?
- How to filter a table in post content without plugins? [closed]
- Get Current User info using wp_localize_script, in functions.php
- Why won’t my scripts load?
- How to hide unused profile fields?
- wp_register_script(… $in_footer = true) not working
- is_customize_preview() like function to check if Customizer “Live Preview” in JavaScript
- Right way to update widget on dynamic new input field
- Not sure if enqueuing js scripts properly
- call of javascript function to external url always blocked by cors
- Jquery implementation not working on page reload
- Overwriting the menu break points of twentysixteen in child theme
- How do I remove the date and category form my portfolio pages
- PHP mixed with some JS code to update WordPress theme settings
- Load jquery only for certain pages in the backend
- using jQuery on only one page
- Can’t call Javascript function – scope?
- Changing parent element’s class or style
- Adding jQuery datepicker to Custom Post Type Metabox [closed]
- In jquery use php variable to execute an enqueued jquery file
- Add php code to wp_print_scripts?
- How can i unload effect.min.js file?
- wp_enqueue_script | Help me figure out what is causing jQuery is not defined
- The correct way to add a JavaScript in the functions.php [closed]
- Theme JS is available but theme CSS isn’t
- Need help with customalert that it would read on a normal page, but not in WordPress
- Passing Jquery value to WordPress function
- WordPress can’t get jquery/unslider to work
- Linking Javascript in functions.php file
- Dequeue scripts in IE7 only using functions.php
- get content from page through AJAX
- colorbox not loading in
- Get URLs for AJAX Filter Checkboxes WordPress
- How to change text color depending on the number value (Using javascript)
- Add custom taxonomy using JS in post editor
- Display Script in Header When URL Variable Present
- Populate Product Regular Price with a calculated ACF Field Value
- Ajax Form Issues using Lightsail (AWS)
- What is the earliest Hook a Script can use?
- WordPress does not load jQuery
- post value to function with Ajax and jQuery
- Ajax in plugin fails – but only on one blog – no idea why
- Help wiht adding fullcalendar.io to a WordPress page
- How do i create a search option for pdf’s only
- Load scripts into an AJAX div
- Load scripts into an AJAX div
- admin-ajax.php & my wp-admin folder url showing in header
- True parameter but jquery register in header and not in the footer with wp_register_script
- wordpress ajax is not working for dropdown selection
- Javascript and Stylesheet in child page
- Search and Replace Script Loader in Head Only Works in Footer
- custom post with loading script per single post
- jQuery HoverIntent is not a function
- java script error Uncaught SyntaxError: Unexpected token ILLEGAL
- Ajax call does not work for this custom code
- new to javascript – using in instead of functions.php, not loading correctly
- Owl Carousel and WordPress Integration Via WP_Enqueue
- AJAX values converted to PHP Variables?
- Get all users from role and add to dropdown (select) – wordpress, javascript
- WordPress enque the same script causes the setInterval not to work