I’m making an ajax site. How would I go about executing some javascript every time the url changes. Say when “/#page/aboutus/” changes to “/#page/news/”.
I want users to be able to bookmark ajax-pages.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
This may be easier to do a different way, for example a
.live()event handler:But, if you do indeed need to trigger with
location.hashchanges, you can use theonhashchangeplugin for this (at least until it’s supported natively in every browser).For example: