'pageshow' is not received when pressing “back” button on Safari on *IPad"

前端 未结 6 1452
终归单人心
终归单人心 2020-12-01 11:08

I have the following handler:

        $(window).bind(\'pageshow\', function() { alert(\"back to page\"); });

When I navigate away from the

6条回答
  •  执念已碎
    2020-12-01 11:42

    What you're doing there is binding the return value of alert("back to page") as a callback. That won't work. You need to bind a function instead:

    $(window).bind('pageshow', function() { alert("back to page"); });
    

提交回复
热议问题