I am using jquery ajax get.
SO when my form is submitted it then submits to a php file but the url stays the same because i am using ajax.
$('#search').submit(function() {
$.get("http://example.co.uk/ajax/post.php", $(this).serialize(),
function(response){
$('#content').html(response.content);
},"json");
return false;
});
Ok this work url will stay the same. http://www.example.com
ok if i remove the return false so i get the default functionality of the form i get the following.
www.example.com?name=test&location=wales
ok here is what i am looking for i want to use ajax but still have the params appended to the title reason for this is i want my url to be shared with others so it will pull down the params from it.
example
www.example.com // will just so the basic page
but
www.example.com?name=test&location=wales // will show the page specific to wales
Any help please???
You’d probably need to use the hash (.com/#) in order for this to happen as you can’t just edit the URL.
Ben Alman’s jQuery hashchange event plugin is probably a good start. It allow you to detect when it changes.
This tutorial may also help: Enabling the Back Button by jQuery for Designers.