Hi. I’m a total beginner JS (used html/css in the past a bit)
I’ve been ordered to prepare a simple website and I’ve found the following on some website to load some content into a div without reloading everything on the page.
[code=html]<script type=”text/javascript” src=”jquery-1.3.2.min.js”></script>
<script language=”javascript”>
function Load(div, link) {
$(div).load(link);
}
</script>
<a href=”#” onclick=”Load(‘#page-content’,’project.htm’);”>About the Project</a>
It works and loads project.htm into div id=page-content.
The problem is that it adds just the hash to the main html (default.html) in the website url. When I hit F5 I go back to the main page as even though the content of some div’s is different, the url is still just default.html.
I dont have time to start learning JS from scratch as it’s just to be done and forgotten. Could you help me out with this?
When I click a link it should load some content into a div and alter the url so when someone refreshes the page or shares a link with someone he can see what he is meant to not the main page.
Thanks in advance.