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
- jQuery Plugin to use WordPress functions in AJAX request
- Check if email address exists front end with AJAX in a plugin
- Pass a php string to a javascript variable
- Confused about shortcode and settings values
- Running jquery script after shortcode [closed]
- Problem in loading javascript in footer
- JQuery not working in my plugin [closed]
- Shortcode button dosent work for all posts. Work for first post only
- Form isn’t inserting data into database with ajax plugin
- 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
- Time consuming callbacks in customizer
- 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
- WordPress + JavaScipt + AJAX + MySQL: insert query for form
- accessing wp.media api from a tinymce plugin
- How to load wp_editor via AJAX
- 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
- Create shortcode to echo javascript
- how to insert data in wordpress table usnig jquery ajax
- Redirect to another page using contact form 7? [closed]
- AJAX fileupload – TypeError: not a function ajaxSubmit()
- “Conflict” with jQuery (or its plugins)?
- Render Modula Plugin Shortcode On Ajax Request
- How to add a dvi tag to a shortcode then change a generated text using jQuery
- Deactivate JS Script in Plugin Shortcode
- 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?
- JQuery needs to be defined in , but Gravity Forms is defining it in the
- Disable submit button order
- How to include my Ajax calls in one function instead of calling different ones every time?
- How to prevent tabs from opening all at once
- Executing Javascript in Plugin
- JS Plugin not executing the js correctly. Trying to make all internal links scroll smoothly
- Call javascript functions from each page
- Using AJAX to run SQL statement and populate dropdown
- Ajax request sends url rather than data
- Javascript from Easy-Fancybox place into footer
- 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
- Trouble with AJAX using GET
- Overriding inline !important CSS with Javscript code snippet with media query
- WP Ajax DB issues
- Get the link title attribute and send it google analytics as custom label via google tag manager using beehive pro for WordPress
- Calling PHP function with AJAX
- 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?
- jQuery Ajax not loading page with ACF fields
- 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
- How to solve Blocked a frame with origin from accessing a cross origin frame error in wordpress?
- 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
- How to limit each front-end user to view just his own uploaded files on Amazon S3?
- Not getting result using ajax on wordpress
- Javascript not working
- WordPress ajax not working in registration
- AJAX doesn’t pass variables to the php function in the plugin
- How do I convince this button to do something when it is clicked?