Skip to content

statechage is triggered everytime pushState is called #96

Open
@matteomelani

Description

@matteomelani

Probably I am just very confused....

so in Firefox 6.0.1 everytime I call pushState the statechange event get fired. Is this the expected behavior?

How do you go about restoring the state of your page?

For example let's say I have page users/1/post_board, the page presents to the user a list of posts. Now the user can simply filter the post by clicking a button. The button does an ajax call to /users/1/post_board?author=john.
The app javascript invokes History.pushState() with a state object that contains all the info so that when the statechage event is triggered the page can be rebuilded. But since pushState trigger a statechage the page gets built twice.

What am I missing here?
Do you have any example of how this should work? I am sorry to say but the demo is pretty useless since there is not state rebuilding in it.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions