I have a problem with jquery, for example, i have this code:
<a href="#" id="docs"><img id="icon" src="icons/docs.png"/></a>
$("#docs").click(function() {
$("#content").load("docs.php").hide().fadeIn("slow");})
All the things works fine, except that when i reload the website it goes back to the previews situation, but i want the website to still as it is when the link clicked.
You can use the hashtag in the URL to detect this.
First, put your ajax request in a function, and then call this function in two cases: a) when the user clicks on the link; b) if the hashtag is “#load_docs”.
Don’t forget to add
href="#load_docs"to your link: