Convert pushstate to js