I'm using the BBQ jquery plugin for AJAX history management, but I'm having a problem getting 'pretty urls'. I've tried everything I can think of, but hopefully I'm missing something stupid and someone can point me in the right direction.
I'm serializing a form for only inputs that are filled to avoid empty querys in the hash fragment. Alerting decodeURIComponent is showing the string how I want it, yet I'm still ending up with #hashfragment=key%26value%3Dkey%26value
Can anyone help? The related code is below.
stateQuery = $('#searchUsers :input[value]').serialize();
stateQuery = decodeURIComponent(stateQuery);
// Push the state into history and replace any other keys
$.bbq.pushState({ search: stateQuery }, 2);
Thanks.
Well, I found a solution to my problem, not quite as graceful as a clean string of parameters but until I figure something else out it'll do.
Before pushing the state, use jQuery bbqs param.fragment.noEscape function to unescape some unimporant characters (sadly trying to escape & and = stops the state functionality from working), then replace '=' and '&' characters in the string being pushed into the state.
Then when getting the state, before pushing it to a function to update the page re-replace the delimiters with '=' and '&' and everything passes through just fine.