Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. JavaScript
  4. jquery wait

jquery wait

Scheduled Pinned Locked Moved JavaScript
javascriptquestion
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • F Offline
    F Offline
    fififlowertot
    wrote on last edited by
    #1

    Hi , I on button click I open a jquery modal with iframe which loads another aspx page. Now this other aspx page makes a call to webservice and then loads data. I have the service call on the page load of this page. So there a gap between the modal window opens and the data load in it. How can I implement a wait gif or just a text like say 'processing' till the data loads? Thanks My code is as below

    <div id="mydiv" >
    <iframe id ="popup" width ="100%" height="50%"></iframe>
    </div>

    jquery/javascript

    function openDialog() {

            var url = "test.aspx?NAME=" + encodeURIComponent($("#<%=txtName.ClientID %>").val());            
            $("#popup").attr("src", url);
    
            $("#mydiv").dialog('open');
        }        
    

    $(document).ready(function() {

            $("#mydiv").dialog({
                autoOpen: false,
                modal: true,
                width: 500,
                scroll: true
    
            });
    
        });
    
    N 1 Reply Last reply
    0
    • F fififlowertot

      Hi , I on button click I open a jquery modal with iframe which loads another aspx page. Now this other aspx page makes a call to webservice and then loads data. I have the service call on the page load of this page. So there a gap between the modal window opens and the data load in it. How can I implement a wait gif or just a text like say 'processing' till the data loads? Thanks My code is as below

      <div id="mydiv" >
      <iframe id ="popup" width ="100%" height="50%"></iframe>
      </div>

      jquery/javascript

      function openDialog() {

              var url = "test.aspx?NAME=" + encodeURIComponent($("#<%=txtName.ClientID %>").val());            
              $("#popup").attr("src", url);
      
              $("#mydiv").dialog('open');
          }        
      

      $(document).ready(function() {

              $("#mydiv").dialog({
                  autoOpen: false,
                  modal: true,
                  width: 500,
                  scroll: true
      
              });
      
          });
      
      N Offline
      N Offline
      Not Active
      wrote on last edited by
      #2

      You don't really need to use an iframe in this instance, at least that I can see. iframes are typically used to display content from a different source, like a different URL. You can simply replace the the HTML content of the div. That would give you more control over the process The general idea is

      function openDialog()
      {
      $("#wait").show();

      $.ajax({
      url: "test.aspx?NAME=" + encodeURIComponent($("#<%=txtName.ClientID %>").val());,
      success: complete;
      }
      });
      }

      function complete(result)
      {
      $("#wait").hide();

      $("#mydiv").html(result);

      // show dialog

      }


      I know the language. I've read a book. - _Madmatt

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups