Topic
  • 3 replies
  • Latest Post - ‏2014-09-20T11:14:24Z by jitupkp
SystemAdmin
SystemAdmin
1140 Posts

Pinned topic Ajax Spinner Question

‏2012-06-06T21:26:59Z |
Hi,

I'm implementing a spinner while a ajax call is being made. I have included this in my header and footer (see below)... however when i open a page it automatically shows the spinner when there is no ajax call. How do i set the spinner to hide until the ajax is called?

Thanks.





And this in my footer...

Loading
Loading...
Updated on 2012-06-06T21:29:10Z at 2012-06-06T21:29:10Z by SystemAdmin
  • SystemAdmin
    SystemAdmin
    1140 Posts

    Re: Ajax Spinner Question

    ‏2012-06-06T21:29:10Z  
    ok the code didn't show..

    in header...
    
    <br /> <br /> <script type=
    "text/javascript" src=
    "<%out.print(path);%>/js/jquery.min.js"></script><br /> <br /> <script language=
    "javascript"><br /> $(document).ready(function()
    {<br /> $(
    "#spinner").bind(
    "ajaxSend", function() 
    {<br /> $(
    
    this).show();<br /> alert(
    "show");<br /> 
    }).bind(
    "ajaxStop", function() 
    {<br /> $(
    
    this).hide();<br /> 
    }).bind(
    "ajaxError", function() 
    {<br /> $(
    
    this).hide();<br /> 
    });<br /> <br /> 
    });<br /> </script><br />
    


    in footer...

    
    <br /> <div id=
    "spinner" class=
    "spinner" > <img id=
    "img-spinner" src=
    "<%out.print(path);%>/images/spinner.gif" alt=
    "Loading" style=
    "margin-bottom:10px;"/><br /> <span id=
    "loading_text">Loading...</span><br /> </div>
    
  • jitupkp
    jitupkp
    104 Posts

    Re: Ajax Spinner Question

    ‏2014-09-20T11:14:00Z  

    see more

    http://techgurulab.com/course/ajax-quiz-online/

  • jitupkp
    jitupkp
    104 Posts

    Re: Ajax Spinner Question

    ‏2014-09-20T11:14:24Z  
    ok the code didn't show..

    in header...
    <pre class="jive-pre"> <br /> <br /> <script type= "text/javascript" src= "<%out.print(path);%>/js/jquery.min.js"></script><br /> <br /> <script language= "javascript"><br /> $(document).ready(function() {<br /> $( "#spinner").bind( "ajaxSend", function() {<br /> $( this).show();<br /> alert( "show");<br /> }).bind( "ajaxStop", function() {<br /> $( this).hide();<br /> }).bind( "ajaxError", function() {<br /> $( this).hide();<br /> });<br /> <br /> });<br /> </script><br /> </pre>

    in footer...

    <pre class="jive-pre"> <br /> <div id= "spinner" class= "spinner" > <img id= "img-spinner" src= "<%out.print(path);%>/images/spinner.gif" alt= "Loading" style= "margin-bottom:10px;"/><br /> <span id= "loading_text">Loading...</span><br /> </div> </pre>

    see more

    http://techgurulab.com/course/ajax-quiz-online/