最近在学习前端的知识,于是就想写一个简单的页面跳转,必须是勾选了“我同意”这个选项以后才能跳转,否则不能,不废话,直接上代码。

首先是第一个页面:testlogin1.html

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<script>
    type="text/javascript"
    src="http://localhost:63342/python 文件/testlogin.html"
</script>
<body bgcolor="#ffffff" οnlοad="loadedvar=true;">
<form name="terms" action="http://localhost:63342/python 文件/testlogin.html" method="get">
    我同意: <input type="checkbox" name="agree" value="ON">
    <input οnclick="if (loadedvar) {if (document.terms.agree.check