Ajax, jQuery and WordPress

Wrap your javascript code with document.ready, and if it works I would suggest going back to putting this in an external file jQuery(document).ready(function(){ jQuery(‘#ajax_form’).on(‘submit’, function(e) { e.preventDefault(); console.log(‘Here’); var form = jQuery(‘#ajax_form’); var data = form.serialize(); data.action = ‘add_word_to_form’ jQuery.post(‘/wp-admin/admin-ajax.php’, data, function(response) { alert(data); }); //return false; }); });

jQuery AJAX add json2 dependency?

You don’t have to manually handle dependencies. That is the whole point of the enqueue system, it handles dependencies for you. There’s nothing wrong with the code in your post, so if you want help on it, you’ll need to ask about your problem more specifically.

Possible jquery / library conflict in plugin usage

The gallery plugin is loading it’s scripts before the jQuery migrate script which is being loaded by the jquery updater plugin <script type=”text/javascript” src=”http://www.riccardo.it/newtech/wp-content/plugins/jquery-updater/js/jquery-2.1.0.min.js?ver=2.1.0″></script> <script type=”text/javascript” src=”http://www.riccardo.it/newtech/wp-content/plugins/gallery-plugin/fancybox/jquery.mousewheel-3.0.4.pack.js?ver=3.5″></script> <script type=”text/javascript” src=”http://www.riccardo.it/newtech/wp-content/plugins/gallery-plugin/fancybox/jquery.fancybox-1.3.4.pack.js?ver=3.5″></script> <script type=”text/javascript” src=”http://www.riccardo.it/newtech/wp-content/plugins/jquery-updater/js/jquery-migrate-1.2.1.min.js?ver=1.2.1″></script> This is causing a JavaScript error which is preventing other scripts from running. Try disabling the jQuery updater plugin and let WordPress … Read more

Bootstrap with Flexslider jQuery Issue

The code you wrote is NOT including the flexslider code, it is only trying to include a google hosted copy of jquery. wp_register_script( ‘flexslider-jquery’, # this is just the Google Hosted version of jQuery ‘https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js’, ”, true ); You probably want something more like this: wp_register_script( ‘flexslider-jquery’, get_template_directory_uri() . ‘/js/jquery.flexslider-min.js’, array( ‘jquery’ ), false, true … Read more