Jquery UI,Dialog,Ajax

$("#dialog").dialog({
      resizable: false,
      height:140,
      width:200,
      modal: true,
      buttons: {
	        "确定删除": function() {
	          $.ajax({
                        type: "POST",  
                        url: "networkArea/getState.do",  
                        data: {"msg":"getState","flag":1},  
                        dataType: "json",//服务器返回内容格式  
                        success: function(data){  
        	            //var result = JSON.parse(data); 
        	           //alert(data.networkState);
        	           if(data.networkState==1){
        		   $("#networkState").css("color","green");
        		   $("#networkState").text("On");
        	              }
                            }
			});
			  $( this ).dialog( "close" );
	        },
	        Cancel: function() {
	          $( this ).dialog( "close" );
	        }
          }
       });

相关推荐