Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

preload until the content of a jquery dialog is loaded

Posted on 2014-07-22
1
Medium Priority
?
508 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

Build and deliver software with DevOps

A digital transformation requires faster time to market, shorter software development lifecycles, and the ability to adapt rapidly to changing customer demands. DevOps provides the solution.

Question has a verified solution.

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

Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
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…
Suggested Courses

722 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