This works flawlessly!
var AnchorChecker = {
initialize: function(){
this.location = location.href;
this.interval = setInterval(function(){
if (this.location != location.href)
{
this.anchorAltered();
* this.location = location.href;*
}
}.bind(this), 500); // check every half second
},
anchorAltered: function(){
// the url has been altered
}
};
AnchorChecker.initialize();
so the current locations is updated and it works fine!
Atenciosamente
--
Mauro Marchiori Neto
email: [EMAIL PROTECTED]
cel: 19 9129.9960
cel: 19 7806.9676
id: 80*15224
On Thu, Oct 9, 2008 at 2:08 PM, Justin Perkins <[EMAIL PROTECTED]>wrote:
>
> On Thu, Oct 9, 2008 at 12:03 PM, Mauro Marchiori Neto
> <[EMAIL PROTECTED]> wrote:
> > setInterval right? wouldnt it overload the browser?
>
> Not necessarily, as long as your URL checking function is simple and
> you don't check very frequently. Say, something like this:
>
> var AnchorChecker = {
> initialize: function(){
> this.location = location.href;
> this.interval = setInterval(function(){
> if (this.location != location.href) this.anchorAltered();
> }.bind(this), 500); // check every half second
> },
> anchorAltered: function(){
> // the url has been altered
> }
> };
>
> AnchorChecker.initialize();
>
>
> ^ 100% untested, beware
>
> -justin
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
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 [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---