History and onpopstate

21 views
Skip to first unread message

pedz

unread,
Jul 9, 2011, 11:37:25 AM7/9/11
to prototype-s...@googlegroups.com
My first attempt to use HTML 5's onPopState isn't working.  I did:

    $$('body')[0].on('popstate', Raptor.makeWrapper(function(event) {
    console.log('popped');
    }));

I've tried a few different capitalizations but, so far, it isn't logging the 'popped' message.

Any suggestions on how to hook this up?  It appears (from the HTML 5 documentation) that the event handler needs to be hooked to the body element.
 

pedz

unread,
Jul 9, 2011, 2:16:49 PM7/9/11
to prototype-s...@googlegroups.com
This isn't using prototype but works:

window.onpopstate = function (even) { ... };

new Event.Handler(element, ...) requires element be an element.  window doesn't work.  Not a big deal.  I'm using Firefox 5.  I don't know (yet) how portable the above is going to be.

Reply all
Reply to author
Forward
0 new messages