在 HTML 中當視窗歷史記錄發生變化時執行指令碼?
當視窗的歷史記錄發生變化時,onpopstate 事件觸發。 您可以像這樣新增它 -
示例
<!DOCTYPE html> <html> <body onpopstate = "onpopstateFunction()"> <p>This is demo text</p> </body> </html>
廣告
當視窗的歷史記錄發生變化時,onpopstate 事件觸發。 您可以像這樣新增它 -
<!DOCTYPE html> <html> <body onpopstate = "onpopstateFunction()"> <p>This is demo text</p> </body> </html>