Using jQuery to add an additional parameter to the current URL without reloading the page? -
a client has page on website list of staff. when user clicks on name, using jquery, bio section on right fade out of current bio, , fade in selected bio.
this fine, issue can't link specific bio's, it's under same url.
i have jquery retrieve parameter url, , show correct bio on page load, problem need change/add parameter on each staff name click, ready copied , pasted.
the list of links looks this:
<ul class="team_list"> <li><a href="#">staff name 1</a></li> <li><a href="#">staff name 2</a></li> <li><a href="#">staff name 3</a></li> </ul>
is possible without reloading pages?
use url fragment, aka hash-value:
<ul class="team_list"> <li><a href="#name1">staff name 1</a></li> <li><a href="#name2">staff name 2</a></li> <li><a href="#name3">staff name 3</a></li> </ul>
you can use window.location.hash
on load of page retrieve value , display right bio needed.
Comments
Post a Comment