history.js
history.js copied to clipboard
<title> tag position is important
Hi.
I was trying to set up History.js on a project, and I didn't know why but if I did something like:
History.pushState({state:1}, "test 1", "my_url");
History.back();
Everything worked "fine" except but the original title of the page wasn't being set to its original value, an empty string was displayed instead (Firefox 10.0.2) .
After hours :( ... I realized that the problem was that I was setting mi title tag right before closing the head tag and after including mi History.js related scripts.
Maybe the title tag must just be placed before History.js is included, I don't know, but placing it right after the head tag is opened solved the problem.
Regards. Carlos Cardenas.