Topic
IC4NOTICE: developerWorks Community will be offline May 29-30, 2015 while we upgrade to the latest version of IBM Connections. For more information, read our upgrade FAQ.
3 replies Latest Post - ‏2014-09-20T11:14:24Z by jitupkp
SystemAdmin
SystemAdmin
1140 Posts
ACCEPTED ANSWER

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
    ACCEPTED ANSWER

    Re: Ajax Spinner Question

    ‏2012-06-06T21:29:10Z  in response to SystemAdmin
    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
    ACCEPTED ANSWER

    Re: Ajax Spinner Question

    ‏2014-09-20T11:14:00Z  in response to SystemAdmin

    see more

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