How I can stop periodically_call_remote?


#1

I need make progress bar with following function:

Ruby on Rails code

<%= periodically_call_remote(:update => ‘progress-bar’, :url => {
:action => :progress },
:frequency => 0.1 , :complete => “check(request)”) %>

How I can stop it?
If I have this:

/* JavaScript code */
function check(request, object) {
if (request.responseText == ‘abort’) {
// code for stop periodically update
}
}


#2

Ilyas wrote:

I need make progress bar with following function:

Ruby on Rails code

<%= periodically_call_remote(:update => ‘progress-bar’, :url => {
:action => :progress },
:frequency => 0.1 , :complete => “check(request)”) %>

How I can stop it?
you can add a :condition option to the periodically_call_remote, making
the method depend on the checkbox’s value. when checkbox is checked/(or
unchecked), the method stop to call.