Question: Is it possible to get the status of the process triggered by a request.

Suppose, I have a request, that will trigger the long running process, like copying some files in the server side, or some other really long running process. Now I want to show user about the percentage completion of that task. 

How to do it in Java Servlet, or any other frame which supports this?

What I thought was sending the continous response to the page. But this may not be possible. Please help me with this problem.

Thanks.

Answer: 
Pass a reference to the div contained within the button to the circleTextShow / Hide functions.

```
//MOUSEOVER
        $(".blockButton").mouseenter(function() {
            //Passing on .class div to a function
            circleTextShow($(this).find('.blockButtonTips'));
        })
        //MOUSEOUT
        $(".blockButton").mouseleave(function() {
            var blockbutton = this;
            timer= setTimeout(function() {
                //Passing on .class div to dis-appear to a function
                circleTextHide($(blockbutton).find('.blockButtonTips'));
            }, delay);
        });

```

Then within the functions, you can reference the tips as so:

```
  //Toggle div animation
  function circleTextShow(element) {
     //make div appear animation code
     $(element).show();
  }

  function circleTextHide(element) {
     //make div dis-appear code     
     $(element).hide();
  }

```
A slightly modified bulletproof approach using  

`.on([delegated events])`,  

`Ternary operator (?:)`,  

`inversed-hover-intent` using the `data-*` attribute,  

 and moving the `setTimeout` in your function  

**gives this beautiful result:**

`**[LIVE DEMO](http://jsbin.com/ewusuq/3/edit)**`

```
$(".blockButton").on('mouseenter mouseleave', function( e ) {
    var $tip = $('div', this); // Target the children .blockButtonTips 
    return e.type=="mouseenter" ? circleTextShow($tip) : circleTextHide($tip) ;
});

function circleTextShow( tip ) {
    clearTimeout( tip.data('wait') );
    tip.stop().fadeTo(500,1);
}

function circleTextHide( tip ) {
    tip.data('wait', setTimeout(function(){
       tip.stop().fadeTo(500,0);
    },300) );        
}

```