Solved

preload until the content of a jquery dialog is loaded

Posted on 2014-07-22
1
493 Views
Last Modified: 2014-07-23
I have this code :
<script type="text/javascript">
$(function() {
  $(".busqueda").click(function(){
  var element = $(this);
  var del_id = element.attr("id");
  var del_name = element.attr("name");

  function loadData(page,del_id,del_name){
     $.ajax
     ({type: "POST", url: "ajax2.php", data: { page: page, rID: del_id, tID: del_name, ancho: 768 },
       success: function(msg){
         $("#medios").bind('dialogopen').bind('dialogclose', function() {  $(this).dialog('destroy'); })
         .dialog({autoOpen: false, maxHeight: 0.95 * $(window).height(), width: 800, modal: false,
                  position: 'top', resizable: false, autoResize: true }).dialog('open');
	   
	     $(document).ajaxComplete(
	        function(event, request, settings)
		    { $("#tabla").html(msg); }); }
         });
       }
       loadData(1,del_id,del_name);  
       $(document).on("click",'.container .pagination1 li.active',function()
	   { var page = $(this).attr('p'); loadData(page,del_id,del_name);});           
  });
});		
</script>

Open in new window


It works without a problem, but I would like to know if it is possible to add it preload while the content of the "jquery dialog" is loaded?
0
Comment
Question by:altariamx2003
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 

Accepted Solution

by:
altariamx2003 earned 0 total points
ID: 40213568
this is the solution
--------------------------------------------------------
                 function loading_show(){
                    $('#loading').html("<img src='../../imagenes/loading.gif'/>").fadeIn('fast');
                }
                function loading_hide(){
                    $('#loading').fadeOut('fast');
                }  
--------------------------------------------------------
     loading_show();
  $.ajax{

           $(document).ajaxComplete(
              function(event, request, settings)
                { loading_hide(); something}
         });}
--------------------------------------------------------
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction A frequently asked question goes something like this:  "I am running a long process in the background and I want to alert my client when the process finishes.  How can I send a message to the browser?"  Unfortunately, the short answer …
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

740 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question