jQuery forms & updating info

ahh nvm, sorted it: jQuery(document).ready(function($){ $(‘.addtocart’).submit(function(){ var data = {action: ‘my_special_action’,post:$(‘.addtocart’).serialize() }; $.post(“<?php echo admin_url(‘admin-ajax.php’); ?>”, data, function(response){ $(“.eshopajax”).insertAfter(this).fadeIn(100).html(response).fadeOut(3000); setTimeout (clearCart,200); setTimeout (doRequest,500); setTimeout (clearRequest,3000); }); function doRequest(){ var tdata = {action: ‘my_cart’}; $.post(“<?php echo admin_url(‘admin-ajax.php’); ?>”, tdata, function(response){ $(“.ajaxcart”).insertAfter(this).fadeIn(100).html(response); }); } function clearRequest(){ $(“.eshopajax”).empty(); } function clearCart(){ $(“.ajaxcart”).insert(); } return false; }); });

need jquery help

Trim your above code down to.. <?php wp_enqueue_script( “my_script”, plugins_url( ‘/your-script-name.js’, __FILE__ ), array( ‘jquery’ ) ); ?> <?php wp_head(); ?> <?php woo_head(); ?> Place your jQuery into a JS file, then enqueue it with jQuery as a dependancy(as above), this will ensure jQuery is loaded before your script is. Your script also needs to … Read more

Problems with jQuery and is_admin()

Is it possible that you are not adding the jQuery() within an ‘init’ or ‘admin_init’; my guess is ‘yes’. Further, if you use an ‘admin_init’ hook you won’t need to call is_admin(). Better yet, here’s an answer about best practices when using jQuery within WordPress: What is the best way to add custom javascript files … Read more

jQuery slider widget similar to cnet.com

If you can use a plugin, Take a look at the Smooth Slider plugin. It is very good with the ability to add content and/or photos. You can reorder them, and it allows you to use custom post types, pages or posts. It has a lot of customization and using your owns stylesheet you can … Read more