I want to change the url according to the menu pages, so to easily share a link to someone else, since each page has its own url name.
So, I have a function that loads the file content. But how to implement it with the url change also into the function?
<script>
function getfile(data) {
var file= data+'.html';
$('#content').load(file);
}
</script>
Here is the navigation using onclick function.
<ul>
<li><a href="#" onclick="getfile('profile')">Profile</a> </li>
<li><a href="#" onclick="getfile('about')">About</a> </li>
<li><a href="#" onclick="getfile('contact')">Contact</a> </li>
</ul>
<div id="content"></div>