Well I found the culprit, no solution yet though.
As I said the code ran well on a static HTML page, so I copied the exact static HTML into my theme, leaving all the rest out, and it didn’t work.
So it had to be WordPress related, so I turned off installed plugins one by one and the issue was resolved when I disabled the Crayon plugin.
So now onwards in this direction, will update this answer if I find the cause (tips on how to debug something like this are welcome!).
Related Posts:
- How to save the state of a drag and drop jQuery UI Sortables front end layout editor?
- WordPress AJAX File Upload – FrontEnd
- ajax call in wordpress front end
- wp_enqueue_scripts hook is not being called
- Creating multiple enclosing shortcodes and fixing JS issues on click
- WordPress site in China times out on requests to youtube [closed]
- Retrieve post info within AJAX helper function
- Assigning tags to a post from front end using tag-it jquery UI plugin
- I can’t enqueue Suggest.js in frontend – not added
- Youtube Iframe Api play one video at a time
- Dynamically populate Cascading Dropdown from MySQL using JQuery/AJAX [closed]
- Individual Pages are loading halfway down
- JSON parsing error syntax error unexpected end of input
- jQuery $(this) keyword
- jQuery Selector: Id Ends With?
- jQuery dialog popup
- Change Placeholder Text using jQuery
- jquery loop on Json data using $.each
- Click button copy to clipboard
- $(document).on(“click”… not working?
- How to read data From *.CSV file using javascript?
- how to loop through JSON array in jQuery?
- jQuery get the image src
- how to define variable in jquery
- Enqueue core jQuery in the footer?
- How to correctly include jquery-ui effects on wordpress
- Check if user is logged in using JQuery
- I want to enqueue a .js file to my child theme
- How to prevent WordPress from loading the jQuery library at the top of the page
- Adding jquery and thickbox to WordPress theme
- WooCommerce single product edit flexslider settings
- jquery & ajax getting data to php in wordpress
- AJAX returns response 0
- Including javascript for a shortcode
- WordPress Featured Post Slider
- adding the full image path to a wordpress javascript file
- Unable to run jQuery script in my template file
- Dropzonejs with WPCF7 [closed]
- Edit single attachment on click (WP-admin)
- wp_mail very slow
- Unable to uncheck checkbox with jquery in wp admin
- gravity forms jQuery.load into modal [closed]
- jQuery.accordion isn’t a function even when enqueued
- How Can I Add “New” Lazy Load Images To NewsPaper WP Theme? [closed]
- WooCommerce Ajax Cart Update Stopped Working
- WordPress AJAX Load More function duplicating a post
- Send multiple attachments with JQuery and wp_mail() function
- Plugins loading multiple copies of JQuery
- How to wp_enqueue_script jQuery inside a Plugin
- jQuery accordion plugin won’t work once used in WP
- What is the propre way to include jQuery UI Datepicker’s CSS in plugin?
- How register library to use jquery correct
- Why use admin-ajax.php when loading pages through AJAX?
- How do I translate string inside jQuery script with WPML?
- Using Foundation 5 in WordPress Administration Area
- change order of add_action hooks for jquery to be loaded first
- specifying relative file paths in WP with jQuery requests not working
- Can’t delete the default jQuery in the theme
- WordPress jQuery crash [closed]
- Delete post image attachments with jQuery from the front end
- Conditional Tags – Multiple Categories
- Recommended Use of Bootstrap, or JQuery-UI in WP/plugin development?
- Using Jquery submit with ajax request
- Slider’s missing navigation
- Converting a working AJAX form to work with WordPress
- ajax not working in plugin
- Accept a-z and 0-9 (restrict a-z to be lowercase without accents like ñ or ó)
- wp not defined at wp.Uploader.prototype
- Get selected image URL from wp.media.editor.attachment into text input fails. What am I doing wrong?
- How to update WordPress jQuery version?
- Customizer add query to preview URL
- Pass jquery variable to php function and run it
- How to send json data to jquery
- Reload selected post in multiple post query with ajax
- Change button text with user name using jQuery after user login
- Is there a way to move WPML scripts in footer?
- Bootstrap with separate js File
- $_POST empty in using new php file added to theme
- How to blur the_post_thumbnail() via blur.js (jquery)?
- Passing variable data from external jQuery file to options.php
- Custom Javascript not working? [closed]
- Plugin preventing media buttons from working
- Uncaught TypeError: Cannot read property ‘ajax’ of undefined
- :first-child applying to all links [closed]
- Ajax autocomplete based on usercode
- Jquery script not loading on site Front page
- Get selected value with PHP and jQuery
- Javascript block in Twenty Twelve theme
- Add jQuery function to media button
- Why won’t this jQuery work in WordPress?
- jQuery append only works if I select html in admin section [closed]
- jQuery color picker function on change
- Can’t get this jQuery snippet to work with WordPress
- Javascript Loading Effect to URLs
- How to combine jQuery in-place editor with $wpdb->update
- Does anyone know how to load jquery in the footer?
- Use WordPress Built In Jquery
- jQuery Add/Remove Classes Not Working
- Elementor form – checkboxes validation
- How to add input file plain text and submit to publish?