ok, I have looked for the past two days for an example of how to get
the stop method to work. I have yet to find a coheasive example my
code is strate formard. I have three sections to my site. The first is
the about section, second is a ticker section and third is historical
section. So when the user clicks on the ticker section this needs to
update every 15 seconds. The other two pages don't need to update. The
problem is when the user clicks on the about or historical page I see
the PeriodicalUpdater still runnning in the background on firebug.
My code

        /**
         * makePeriodicalUpdater function is a shortcut to the prototype
Ajax.Updater object.
         * @param div the div that you want the response to be written into.
         * @param url the location to send the request to.
         * @param method post or get.
         * @param method pars any parameters that need to be passed.  These
should be in QueryString format.
         * @param eval boolean that decides whether or not scripts should be
evaluated.
         **/
PeriodicalUpdater: function(localDiv, localUrl, localMethod,
localPars, localEval)
        {

                //javascript debug
                        if(siteDebug == 4)
                        {
                                alert('localUrl:' + localUrl);
                                alert('localDiv:' + localDiv);
                                alert('localMethod:' + localMethod);
                                alert('localPars:' + localPars);
                                alert('localEval:' + localEval);
                        }
                        //end javascript debug


                var objName = 'obj'+localDiv;
                alert(objName);
                objName = new Ajax.PeriodicalUpdater(
                        localDiv,
                        localUrl,
                        {
                                frequency : 15,
                                decay: 1.1,
                                method: localMethod,
                                parameters: localPars,
                                evalScripts:localEval,
                                
//onCreate:this.PeriodicalUpdaterLoading.bind(this),
                                
onComplete:this.PeriodicalUpdaterLoadingComplete(localDiv)
                                
//onSuccess:this.PeriodicalUpdaterSuccess.bind(this),
                                
//onFailure:this.PeriodicalUpdaterFailure.bind(this)

                        });
                //alert('PeriodicalUpdater:'+localDiv);
                // Make sure the div is displayed.
                //$(localDiv).style.display='block';
                return true;

                //javascript debug
                if(siteDebug == 4)
                {
                        alert('Getting the Menu Through the menu ajax updater');
                }
                //end javascript debug
        },
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Spinoffs" group.
To post to this group, send email to rubyonrails-spinoffs@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to