【发布时间】:2015-10-27 13:05:42
【问题描述】:
<html>
<head>
<title>Quiz Application</title>
<script type="text/javascript" charset="utf-8" src="cordova-1.9.0.js"></script>
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.css" />
<script src="http://code.jquery.com/jquery-2.1.4.min.js"></script>
<script src="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js"></script>
<script type="text/javascript" charset="utf-8">
function ready() {
if (document.getElementById("rb1").checked) {
alert("correct");
} else if (document.getElementById("rb2").checked) {
alert("incorrect");
} else {
alert("incorrect");
}
function prevpage() {
document.location=document.history.back();
}
}
</script>
</head>
<body id="body2">
<form method="post">
<center><h1>Quiz Application</h1></center><br><br>
<center>Is JAVA Object Oriented Language ?<br><br>
<radiogroup>
<input type="radio" id="rb1"/>Yes<br>
<input type="radio" id="rb2"/>No<br>
<input type="radio" id="rb3"/>May Be<br>
<input type="submit" id="sub" value="Freeze" onclick="ready();"/><br>
<input type="submit" id="next" value="Previous Question" onclick="prevpage();"/></center>
</radiogroup>
</form>
</body>
</html>
上面是我重定向到第一页的代码,但它不起作用。
请帮助我在首页重定向。
我经历了许多选项,例如 window.location=-window.history.back(); ,window.history.back(1/-1) 但它们都不起作用。
在此先感谢:)
【问题讨论】:
-
他们怎么不工作了?发生了什么?控制台中有任何错误消息吗?另外,您能否删除与您的问题没有直接关系的所有代码。请阅读minimal reproducible example。
-
它给出错误文件无法打开先生
-
请将该信息与错误消息的确切措辞一起添加到您的问题中。此外,您可能希望包含有关上一页是什么类型的文件的一些信息,因为它似乎是问题的根源。当previos页面是普通页面时,您应该检查它是否有效。
-
我已经写在下面了,先生
标签: javascript html cordova phonegap-plugins