changeHistory (search) {
var query = '', href = '';
for (var i in search) {
!search[i] && delete search[i];
query += search[i] ? '&' + i + '=' + search[i] : '';
}
href = query ? '?' + query.substring(1, query.length) : location.pathname;
!window.history.pushState ? location.href = href : window.history.pushState(search, null, href);
}
if(!window.history.pushState) return false;
页面前进回退
if (window.history && window.history.pushState) {
window.onpopstate = function (event) {
console.log(event);
console.log(that.condition);
if (window.location.pathname == '/goods/all') {
that.data = JSON.parse(JSON.stringify(event.state));
that.jq.extend(event.state, that.defaultData);
that.submit();
}
};
}