beezee / djax

Dynamic pjax, responds to layout changes across requested pages
http://beezee.github.com/djax.html
171 stars 27 forks source link

Uncaught TypeError: Cannot read property 'url' of null (jquery.djax.js:67) #6

Closed GaryJones closed 12 years ago

GaryJones commented 12 years ago

Using the latest trunk code on http://azzag.co.uk/ I'm getting the error below, as soon as the page loads before any links have been clicked. Chrome 17.0.963.56 m on Win 7.

Uncaught TypeError: Cannot read property 'url' of null (jquery.djax.js:67) $.fn.djax (jquery.djax.js:67) f.event.dispatch (jquery.min.js:3) f.event.add.h.handle.i (jquery.min.js:3)

GaryJones commented 12 years ago

Adding a simple check seems to kill the error, but I don't know if this will affect anything else (generally still seems to work correctly):

if (event.originalEvent.state) {
    self.reqUrl = event.originalEvent.state.url;
    self.navigate(event.originalEvent.state.url);
}
beezee commented 12 years ago

this was just what it needed, thx