Solved.
The problem was that mojs has to be included between the <body></body>
tags, and the wp_enqueue_script() function that enqueued mojs needed an empty string as argument just before the ‘true’ parameter (I forgot to specify that there was no required version number of that script).
So, changing
wp_enqueue_script('mojs', 'https://cdn.jsdelivr.net/mojs/latest/mo.min.js', array('jquery'), true);
wp_enqueue_script('favjs', $favbtnscript, array('jquery', 'mojs'), true);
to
wp_enqueue_script('mojs', 'https://cdn.jsdelivr.net/mojs/latest/mo.min.js', array('jquery'), '', true);
wp_enqueue_script('favjs', $favbtnscript, array('jquery', 'mojs'), '', true);
did the trick.
Related Posts:
- Custom plugin giving: wp-admin/admin-ajax.php 400 (Bad Request)
- How to create popup same as wordpress popup feature
- Only execute jQuery function(on document ready) on the page has shortcode from plugin [duplicate]
- How to put JQuery/Ajax inside shortcode?
- Can someone please tell me what is wrong with my plugin?
- wordpress add_action() issue in ajax call
- Load CSS files in header of Bones theme?
- Jquery POST Ajax Return null data in wordpress
- Ajax Call not Working in Plugin
- Custom plugin giving: wp-admin/admin-ajax.php 400 (Bad Request)
- Ajax, jQuery and WordPress
- Load css classes after using ajax calls
- force enqueue script to be first in order of prominence
- Help making my pagination plugin better
- AJAX Call Via Vanilla JavaScript In WordPress Plugin Development
- jQuery AJAX call not executing in Plugin
- How to save Clicks of a download link button while it doesn’t matter if we refresh the page or again login/logout
- ‘Lazy loading’ list of posts with pagination
- Check javascript file Proper way in functions.php
- How to include admin-ajax when loading external javascript
- How to use wp-ajax in wp-cron
- Calling shortcode in wp_localize_script strips result
- Ajax with jQuery UI dialog not working
- Shortcode in AJAX popup
- jQuery Plugin to use WordPress functions in AJAX request
- Check if email address exists front end with AJAX in a plugin
- Confused about shortcode and settings values
- Running jquery script after shortcode [closed]
- Problem in loading javascript in footer
- Best approach to fetch data from wp options to js file or php file
- wordpress site | All-in-one-cufon IE Issue
- WordPress function not being called from jQuery method
- Change upload folder for a CPT
- Ajax contact form widget plugin data not insert in database
- Modifying a .js Function for Print [QZ Tray, WooCommerce POS]
- Making sure that a plugin’s scripts and stylesheets are included for dynamicaly loaded content
- Redux Framework: Page freezes on typing in Editor
- How can I inject options into an select tag inside the widget form?
- Display wordpress post’s in popup?
- Using color picker in plugin, does input attribute order matter?
- Using window.onload with Ubermenu
- Post Comments with Ajax in WordPress
- AJAX fileupload – TypeError: not a function ajaxSubmit()
- “Conflict” with jQuery (or its plugins)?
- plugin shortcode not working on ajax request call
- How to display checked posts on another page over AJAX? (like comparasion style)
- Localizing methods for jQuery append prepend wrap parent
- How to get specific string/value from an array? php [closed]
- coding a WordPress AJAX Form using PHP to check if User is Logged Out and Show error
- Why does my jQuery plugin show up as text in WordPress?
- Disable submit button order
- How to include my Ajax calls in one function instead of calling different ones every time?
- Using AJAX to run SQL statement and populate dropdown
- Ajax request sends url rather than data
- grab or load text on demand
- Ajax call not working in wordpress through a plugin
- Send Array from JS to php file then insert it in wp database through a plugin
- wc_get_template_part doesnt display the content [duplicate]
- How do I reinit WordPress plugins dynamically using jS?
- login form should redirect to register page for in 1st login next time it should redirected to home page
- Cannot pass value variable to WP AJAX functions
- How to properly enqueue jQuery knob on WordPress without conflict?
- Why does my custom plugin only function correctly once per page?
- How to get a specific string from a url
- Does anybody know how to insert a complete jquery plugin into a wordpress elementor-page?
- Use AJAX to fetch Current Post Thumbnail for WordPress when Uploaded throughMedia Uploader Frontend
- Website always load twice on start
- AJAX update fails for public/non-admin users
- checkout stripe with plugin contact form
- WordPress Ajax request “Failed to load resource: the server responded with a status of 400 ()”
- How to disable/enable PHP plugin functionality based on a TinyMCE toggle-button
- WordPress ajax error 400 bad request for sending data to remote site [duplicate]
- Get shortcode attribute for AJAX call
- Conditional Fields depending on checkboxes
- Overwriting Plugin’s Ajax callback function from theme
- Help with customising love it plugin (use within foreach)
- show-hide based on select option jquery wordpress
- Javascript in plugin not working
- WordPress Feedback popup with date saved into table
- Javascript not working
- WordPress ajax not working in registration
- How do I convince this button to do something when it is clicked?
- Like/Dislike Bar not working when updating
- Possible jquery / library conflict in plugin usage
- Hyperlink to execute PHP
- How to get site homepage from plugin?
- How to load a plugin when doing an Ajax call? [duplicate]
- Trying to override/intercept a PhotoMosaic gallery link in WordPress using jQuery
- Why won’t the Comprehensive Google Map Plugin load?
- get_option include in my adsense
- Element works, but not on wordpress site [duplicate]
- WordPress shortcode plugin not working
- FacetWP: Plugin breaks button/modal functionality inside searchable content area
- TypeErrors with Yoast, jQuery in conflict?
- Javascript as Jquery Function Call?
- How to make a rest style plugin?
- Count div with class (.length) only shows 0 [closed]
- Jquery post responses 500 error after some time and lastly an 503 error
- How do I call an action hook into wp_ajax hook callback function
- Select posts from list and add them in a new list