Can we have code after location.reload(true)?
问题 I have a function that does a reload from server with: location.reload(true) Currently, any code I have after this line is not executed. I'm curious if there is a way to be able to have more code run after the reload? 回答1: The best way to do this would be to write a function that is called if there are certain "GET" variables set and to check them on each run such as mypage.html?reload=true Or even hash locations: mypage.html#reload And you can compare like so: $(document).ready(function () {