Hi,
I have an application with URLs like this:
domain.com/category1/category2/ etc.
I see that ajax understands the # and can pass the params to my php script. I am wondering if there is a way in ajax to do the following URL:
domain.com/#category1/category2/
If so, is there a function that I can use in jquery to do this? I have seen jquery bbq but im a big confused how this helps me. It feels like there is an easier way, to just remove the hash and pass the remaining url to my php script, then return the page fragment?
How would I set up my php script to return the main page fragment without the header and footer being refreshed? Do I need to detect that # or javascript has been called and then return the relevant fragment?
i am trying it this way but its not posting the Ajax : hasher parameter.
<script>
hasher = document.location.hash;
hasher = hash.replace(/^.*#/, '');
$.ajax({ type: 'POST', url: url, data: {ajax:hasher}, dataType: 'html' });
</script>
<?php
echo $_POST['ajax'];
?>
Am I doing something wrong?
Cheers for any helps
Ke