i've been doing some of this poling as well when working on
HistoryManager<http://mootools.net/forge/p/historymanager>,
which also supplies a hashchage event (only its attached to the class
instance instead of to the window).
the thing with this kind of implementation, is that with in experience there
is a notable lag between click and event firing in IE. just noting it.
obviously this is unavoidable...
-----------
אריה גלזר
052-5348-561
5561


On Tue, Jan 26, 2010 at 19:34, 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