You could preserve web application state with JSON in URL like this:
http://host/?state=[{id:1,selected=true},{id:2,selected=false}]
Is this preferable?
One motivation for doing something like this is if the user bookmarks the web page the web application state can be restored the next time the user visits the page.
It might be doable, but I think it’s somewhat bad practice beacuse:
My advice: create an ID for
statebound to your JSON stored in a database (your URL’s would look more along the lines ofhttp://host/?state=123with123pointing to some kind of database record (not that it makes the URL’s very accessible either, but I still think it’s better due to the other points cited).