jquery please wait overlay div

Here you will find a  free php scripts, php resources, php tutorials, web resources , jquery

<?php print "welcome to source world-php script"; ?>

WHAT IS JQUERY?

JQuery is a fast and concise JavaScript Library that simplifies HTML document traversing, event handling, animating, and Ajax interactions for rapid web development.jQuery is designed to change the way that you write JavaScript.

If you want to do some kind of ajax with please wait... overlay div in center of screen than its very easy with JQuery. Example is given bellow.





Here in this example what I have done is display a overlay div on ajax start and hide overlay div on ajax sucess and ajax error or exception.This please wait overlay div is tasted in I.E 7,8,Mozilla,Opera 10.


Jquery Code
var $j = jQuery.noConflict();  //private jquery Conflict
     $j('#btnajaxCall').click(function() {
         
      $j('#SubDiv').show();   
      $j('#mainDiv').show();   
       var str = "name=nikunj&age=22"; //pass post data to server.php  
       $j.ajax({
                   type: "POST",
                   url: "server.php",
                   data: str,
                   success: function(msg){
                     $j('#SubDiv').hide();   
                     $j('#mainDiv').hide();   
                     alert(msg); 
                  },
                  error:function (xhr, ajaxOptions, thrownError){
                       $j('#SubDiv').hide();   
                       $j('#mainDiv').hide();   
                       alert(xhr.status);
                       alert(thrownError);
                }  

           });

});

Download full example


Download

Buy Me a Beer-If you are like this post

 If you does not have paypal account create free account create account

No comments:

Post a Comment