WordPress.org

Ready to get started?Download WordPress

Forums

[Plugin: not published] jQuery? buttons not clickable after update to 3.5.0 (1 post)

  1. Milev
    Member
    Posted 6 months ago #

    Hi,

    I have recently updated my system from 3.3.1 to 3.7.1 and had some trouble with plugins. I managed to fix all but one and as most were related to jQuery probably this is as well. The plugin is dedicated for the website.

    I have used fresh WP installs for testing and found out that the problem with plugin started when I upgraded from 3.4.2 to 3.5.0, where some jQuery libraries were upgraded.

    The problem is buttons doesn't work after update -nothing happens. I think the problem lies in enqueued scripts, but I'm not really familiar with jQuery.

    wp_enqueue_script('jquery');
    wp_enqueue_script('jquery-ui-core');
    wp_enqueue_script('jquery-ui-dialog');
    wp_enqueue_script('jquery-ui-1.8.17.custom.min' );
    wp_enqueue_script('jquery-bgiframe-2.1.2' );
    wp_enqueue_script('jquery-ui-mouse' );
    wp_enqueue_script('jquery-ui-button' );
    wp_enqueue_script('jquery-ui-draggable' );
    wp_enqueue_script('jquery-ui-droppable');
    wp_enqueue_script('jquery-form' );
    wp_enqueue_script('jquery-ui-position' );
    wp_enqueue_script('jquery-ui-resizable' );
    wp_enqueue_script('jquery-effects-core' );
    wp_enqueue_script('jquery-ui-widget' );
    wp_enqueue_style('jquery-style', 'http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.2/themes/smoothness/jquery-ui.css');

    There is as well one script echoed to the page with buttons. It looks as follow.

    <button class="addAward button-primary" id="xxx">text</button>

    The script:

    <script>
    jQuery(document).ready(function(){ 
    
      jQuery(".addAward").click(function(event) {
    	 jQuery(".AwardDialogAdd").dialog("close");
    	 event.preventDefault();
    	 var $info = jQuery("#add_blog_" + jQuery(this).attr("id"))
    
    	 $info.dialog({
    			 "dialogClass"   : "wp-dialog",
    			 "modal"         : true,
    			 "autoOpen"      : false,
    			 "closeOnEscape" : true,
    			 "buttons"       : {
    			 "Close": function() {
    				 jQuery(this).dialog("close");
    			 },
    		}
    	 });
    	 $info.dialog("open");
      });
      jQuery(".delAward").click(function(event) {
    	 jQuery(".AwardDialogDel").dialog("close");
    	 event.preventDefault();
    	 var $info = jQuery("#del_blog_" + jQuery(this).attr("id"))
    
    	 $info.dialog({
    			 "dialogClass"   : "wp-dialog",
    			 "modal"         : true,
    			 "autoOpen"      : false,
    			 "closeOnEscape" : true,
    			 "buttons"       : {
    			 "Close": function() {
    				 jQuery(this).dialog("close");
    			 },
    		}
    	 });
    	 $info.dialog("open");
      });
    });
    </script>

Reply

You must log in to post.

About this Topic