window bind POPSTATE

前端 未结 8 2000
一整个雨季
一整个雨季 2020-12-07 21:25

Given the following:

$(window).bind(\"popstate\", function() {
    alert(\'popstate\');
});

On first load, the alert fires with FireFox and

8条回答
  •  南笙
    南笙 (楼主)
    2020-12-07 21:51

    This is my workaround.

    window.setTimeout(function() {
      window.addEventListener('popstate', function() {
        // ...
      });
    }, 1000);
    

提交回复
热议问题