So... I'm writing this thing with PHP and JQuery/JS; I am not good with either yet....
I want the user to be able to bookmark a page. Right now, I am sometimes sending a lot of data and sometimes sending a little bit so I learned how to use the jquery ajax/post functions and just pass json. However, this prevents the user from being able to bookmark a page. What I am having to do is.... just basically.... actually, I typed it all out, explaining it but no one is going read all that.
So.. I have to reload the data a lot. I'd like to be able to use the URL query string AND post data with jquery.
so...
www.domain.com/kims_stuff.php
www.domain.com/kims_stuff.php?type=0&color=grey
Sorry, I'm not explaining this well. I think I need to just... do... window.location.href = "?type=0&color=grey"
when I want that query string and from there, I can reload or whatever with the json when I need to pass a lot of data.
Right? That's what should be done?
But just checking... is there anyway to put one set of data in the url query string and another set of data in the ajax post json? I am aware that I can load content from other pages into divs on the current page, while keeping the current url... which in this case, the page would already need to have that in the url.
Or is there a better way of allowing pages to be bookmarked when using jquery and ajax?
Typically you use a URL hash:
www.domain.com/kims_stuff.php#type=0&color=grey
As your AJAX state changes, you update the hash. When the page loads, it look at the value of the hash, then execute your JS to restore it to the defined state.