How can I ignore [removed] on page load?

前端 未结 4 1074
一个人的身影
一个人的身影 2020-12-04 23:52

I\'m playing with window.onpopstate, and there is a thing that annoys me a little bit:

Browsers tend to handle the popstate event differe

4条回答
  •  半阙折子戏
    2020-12-05 00:29

    I had a similar problem and i had to validate to make sure if page was loaded completely.

    I used something like this :

    var page_loaded = false;    
    window.onpopstate = function(event){
        if(!page_loaded){
           page_loaded = true;
           return false;
         }
        //Continue With Your Code
    }
    

提交回复
热议问题