方法一:
$(function(){
window.onpopstate = function() {
alert("hello");
};
});
方法二:
pushHistory();
window.addEventListener("popstate", function(e) {
if(location.hash != "#wechat"){
$("#m-dialog").show();
return false
}
}, true);
function pushHistory() {
var state = {
title: "title",
url: ""
};
window.history.pushState(state, "title", "");
}