我有一個表單,一旦它被提交,它'將用戶帶到「謝謝頁面」的想法是,如果用戶點擊後退按鈕,而不是回到表單,它將用戶帶到不同的頁面。我正在使用src="backfix.min.js"
,它正確地位於.js文件中。提醒消息,但由於某種原因,它沒有把用戶帶到我想要的頁面。當點擊後退按鈕「不工作」時重定向到不同的頁面
<!DOCTYPE html>
<html>
<head>
<title>Thank You!</title>
<script type="text/javascript" src="backfix.min.js"></script>
<script type="text/javascript">// <![CDATA[
bajb_backdetect.OnBack = function()
{
alert("Will take you back to the main page");
document.location.href = 'http://goggle.com';
};
</script>
</head>
<body style="background-color: white" >
<div align="center" >
<img alt="thanyou" src="Images/thank_you[2].png" width="800" height="600">
</div>
</body>
</html>
您可以使用window.location.href相同happends嘗試window.location.href –
'window.location.href的''而不是'document.location.href – Ejaz
:警報消息,但當我點擊確定帶我回到形式 – Cessna