History pushState

I didnt get this part of the code working, maybe I did something wrong?
 I temporlarily fixed it to prevent the browser from jumping to the id, but it needs more work.