javascript - How to add question mark parameter instead of forward slash in history js plugin -
trying change url (http://www.rangde.org/gift-cards?theme=anniversary)
but output getting (http://www.rangde.org/gift-cards/?theme=anniversary)
i dont want forward slash in front of question mark parameter pls me fix this
script here:
history.pushstate({state:1,rand:math.random()}, 'designs', '?theme=diwali'); function(){ var history = window.history, // note: using capital h instead of lower h state = history.getstate(), $log = $('#log'); history.log('initial:', state.data, state.title, state.url); history.adapter.bind(window,'statechange',function(){ // note: using statechange instead of popstate var state = history.getstate(); // note: using history.getstate() instead of event.state history.log('statechange:', state.data, state.title, state.url); }); }
not sure if bug or feature, looks adding actual url query helps:
history.pushstate({}, 'new title', window.location.pathname + "?" + ...);
Comments
Post a Comment