Hi TJ.
Yesterday at nigth I solved my problem... I going try to explain what a I
did...

First of all I moved the script who has the PeriodicalUpdater to my js file
and I could use the function globally.

Here the function:

var ajax1 = new Array();
function update_apu(div ,url, freq) {
    i = ajax1.length + 1;
     ajax1[i] = new Ajax.PeriodicalUpdater(div , url, {method: 'get',
frequency: freq, decay: 1, evalScripts: true, onLoaded:
cargando(div,'Loading...')});
}

And a triggered this function from the file how is loaded in the div (from
an ajax call) like this:

update_apu('div_name', 'url_update', 10);

Pay attention, this is the best part, when I want to stop the ajax updater I
call this function from any place from my page.

*This function is in the js file also:*

function det_apu(a) {
    if (a == null) {
        for (i=1;i<ajax1.length;i++) {
             if(ajax1[i]!=null) {
                ajax1[i].stop();
            }
        }
    }
    else {
         if(ajax1[a]!=null) {
            ajax1[a].stop();
        }
    }
}

And I can stop all the ajax updater or just only one.

*Conclutions:*
I was running the PeriodicalUpdater from the same page who was loaded in the
div, when the content of this div changed I lost
the control of the PeriodicalUpdater.

I want to say thanks for all the advices that you give me, may be I could
not find the solution, but was the way to arrive to finally solution.

THANKS!

NB
*PD: A los chicos de la lista de codeigniter les paso la solución ya que
también la había planteado en ese foro y muchos me ayudaron, también
gracias.*

2009/4/25 T.J. Crowder <t...@crowdersoftware.com>

>
> Hi,
>
> Your English is quite good.
>
> Again, just call the stop() method on the updater when you remove the
> container, it's not done automatically for you.  Here's an example:
> http://pastie.org/457897
>
> HTH,
> --
> T.J. Crowder
> tj / crowder software / com
> Independent Software Engineer, consulting services available
>
>
> On Apr 24, 8:56 pm, NonoX <nbul...@gmail.com> wrote:
> > T.J.
> > If the div container doesn't change the stop method works fine, the
> > issue is presented when the div container where the periodicalupdater
> > is executing change... the periodicalupdater still working in
> > background and never stop... the only way for stop that is reloading
> > the page.
> >
> > I hope be clear, I'm not an english speaker.
> > NB
> >
> > On 22 abr, 10:20, "T.J. Crowder" <t...@crowdersoftware.com> wrote:
> >
> > > Hi,
> >
> > > PeriodicalUpdater has a stop method.[1]  So keep a reference to it,
> > > and then call its stop method when you delete the div being updated.
> > > (Changing the div isn't a problem, provided it still exists.)
> >
> > > [1]http://www.prototypejs.org/api/ajax/periodicalUpdater
> >
> > > HTH,
> > > --
> > > T.J. Crowder
> > > tj / crowder software / com
> > > Independent Software Engineer, consulting services available
> >
> > > On Apr 22, 6:35 am, NonoX <nbul...@gmail.com> wrote:
> >
> > > > Hi there, I'm Nahuel from Argentina, and I'm new in this group.
> >
> > > > I have a question about Ajax.PeriodicalUpdater:
> >
> > > > If you use PeriodicalUpdater to return data to fill a component, such
> > > > as a DIV, and that div is then deleted or changed, the
> > > > PeriodicalUpdater continues to run, How can I solve this? I have been
> > > > searching in net, but I can't get the solution.
> >
> > > > My problem is similar to that people:
> >
> > > >
> http://www.ruby-forum.com/topic/147307http://dev.rubyonrails.org/tick...
> >
> > > > Thank!
> >
> >
> >
>


-- 
Saludos
NB.
MSN: nbul...@gmail.com
GTalk: nbul...@gmail.com

Antes de imprimir, pensá en el medio ambiente.
Before printing, think about the environment.
Avant d'imprimer, pensez à l'environnement.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to