How do I remove state fragment search?
state: #tab=2&search=true
$(textbox).click(function()
{
var state = {};
//$.bbq.removeState("search");
state['tab'] = $(this).val();
$.bbq.pushState(state);
});
If I uncomment the removeState line, it will first create a new state consisting of tab=2 replacing it with a new state tab1. How can I just remove the search fragnment and replace tab=2 with tab=1 in 1 new state?
You can use overload method
which replaces completely to new state.
Also note that $.bbq.removeState() as $.bbq.pushState() triggers hashchange event. It may give you unexpected results.