I have a PHP file which returns me a JSON array based on the GET parameters set. I don't want to reload the page so I made a simple function using jQuery + AJAX to show the result in a div tag.
But there is a problem, because of using AJAX doesn't change the URL and the user won't be able to share the link.
The HTML is called 'calculate.html' and the GET URL would be something like this:
myweb.com/calculate.php?sex&female&age=23&brand=pull%26bear&msg=hello%20stackoverflow
I'd like to know what is the best practice to modify the URL of the HTML when the AJAX call returns the result. And when someone open this URL the HTML reads it and then executes the call with these parameters.
I've modify the .htaccess
and this is the url of the html:
myweb.com/calculate/
And with the parameters:
myweb.com/calculate/female/23/pull%26bear/hello%20stackoverflow
Any tip, advice or help would be appreciated, and if you need more information, let me knoe and I'll edit the post.