Yeah. And you can configure the duration of the poller through assignment:

if (Element.Events.hashchange) Element.Events.hashchange.duration = 50; (or
whatever)

You can also stop the poller:

if (Element.Events.hashchange) $clear(Element.Events.hashchange.timer);


On Tue, Jan 26, 2010 at 10:01 AM, Eneko Alonso <[email protected]>wrote:

> Works fine for me (Firefox 3.5 vs. 3.6)... and I actually got the code from
> Mozilla:
> https://developer.mozilla.org/en/DOM/window.onhashchange
>
> Your code looks good, though, I'll give it a try. So, in order to use it,
> you would have to add an event to the window, right?
> <https://developer.mozilla.org/en/DOM/window.onhashchange>window.addEvent('hashchange',
> ...);
>
>
>
>
> On Tue, Jan 26, 2010 at 9:34 AM, Aaron Newton <[email protected]> wrote:
>
>> That "onhashchange" in window stuff doesn't work in firefox. Here is my
>> completely untested version:
>>
>> http://gist.github.com/286636
>>
>>
>> On Tue, Jan 26, 2010 at 9:31 AM, Eneko Alonso <[email protected]>wrote:
>>
>>> I Aaron,
>>>
>>> I think that is a great idea. Currently in our project we are detecting
>>> if the browser supports window.onhashchange and if not we start pooling.
>>>
>>> if ("onhashchange" in window) {
>>>  window.onhashchange = this.hashChanged.bind(this);
>>> } else {
>>>  // start pooling
>>>  }
>>>
>>> I was wondering how would you implement that custom event. Would you add
>>> it to the window object?
>>>
>>> Thanks
>>>
>>>
>>> On Mon, Jan 25, 2010 at 4:15 PM, Aaron Newton <[email protected]> wrote:
>>>
>>>> I was considering making a MooTools custom event that does this for you.
>>>> If you're in a browser that doesn't support the event, it would start a
>>>> global poller. Just never got around to it...
>>>>
>>>>
>>>> On Fri, Jan 22, 2010 at 3:12 PM, fakedarren 
>>>> <[email protected]>wrote:
>>>>
>>>>> Firefox 3.6 and IE8 have an onHashChange event you can use - the other
>>>>> browsers I believe you would need some kind of polling.
>>>>>
>>>>> On Jan 22, 10:46 pm, Ryan Florence <[email protected]> wrote:
>>>>> > Is polling the only way to check for changes in the
>>>>> > window.location.hash?
>>>>> >
>>>>> > Sent from my iPhone
>>>>>
>>>>
>>>>
>>>
>>
>

Reply via email to