dancrew32 / AWESOME-JS

A Lightweight JavaScript Framework that performs common tasks (IE6, 7, 8, FF, WK, Opera)
awesomejs
2 stars 0 forks source link

add history plugin #7

Open dancrew32 opened 13 years ago

dancrew32 commented 13 years ago

that pushes history states to back button, which can be revisited by hash indicator

dancrew32 commented 13 years ago

for getting hashchange:

var page_url = 'http://www.yoursite.com/'; // full path leading up to hash; var current_url_w_hash = page_url + window.location.hash; // now you might have something like: http://www.yoursite.com/#123

function TrackHash() { if (document.location != page_url + current_url_w_hash) { window.location = document.location; } return false; } var RunTabs = setInterval('TrackHash()', 200);