我有一个HTML表单。
但是,当我点击 "Let's Go" 按钮时,没有任何反应。我看到 Internet Explorer 加载了几分钟,然后显示消息 “网页未响应”。如果我按下刷新按钮,它会跳转到
很少会出现以下信息:
以下是放置在表单上面的JavaScript代码:
<form name="nextform" action="anotherpage.php" method="post" enctype="multipart/form-data">
<input name="pinid" id="pinid" type="hidden">
<input type="submit" name="submit" id="post" value="Lets Go" class="formButtonMap">
</form>
pinid
动态获取了一个JavaScript的值。当它得到值时,我会弹出提示窗口,这个功能正常。但是,当我点击 "Let's Go" 按钮时,没有任何反应。我看到 Internet Explorer 加载了几分钟,然后显示消息 “网页未响应”。如果我按下刷新按钮,它会跳转到
anotherpage.php
但表单中的值并没有传递给服务器。很少会出现以下信息:
这种行为只在 Internet Explorer 11.0.2 中观察到。该表单可以在旧版本的Internet Explorer以及Chrome和Firefox中正常工作。在IE的控制台中没有错误信息。Visual Studio Just-In-Time Debugger
iexplorer.exe [688] 中发生未处理的 win32 异常
可能的调试器:
新 Microsoft Visual Studio 2012 实例
以下是放置在表单上面的JavaScript代码:
// called when another button is clicked - basicaly is websockets
function save() {
var so = new WebSocket("ws://localhost:8000");
so.onerror = function (evt) {
alert('problem');
}
if (sara == 'LINES') {
so.onopen = function() {
so.send(JSON.stringify({
command: 'insertAll',
name: document.getElementById('name').value
}));
}
}
if (sara == 'POLY') {
so.onopen = function() {
so.send(JSON.stringify({
command: 'insertHalf',
name: document.getElementById('name').value
}));
}
}
so.onmessage = function (evt) {
var received_msg = evt.data;
document.getElementById("next").style.display = "block";
document.getElementById("name").value = "";
document.getElementById("descr").value = "";
clearLinks();
document.getElementById("pinid").value = received_msg;
alert(document.getElementById("pinid").value); // works
so.close();
}
}
我尝试使用 document.getElementById("nextform").submit();
编辑代码,但问题仍然存在。
是我的问题吗?还是一个bug?我漏掉了什么?
anotherpage.php
上,请将您的表单提交到另一个(最好是空白)页面,看看是否会出现相同的问题。此外,发布anotherpage.php
的代码也会有所帮助。 - Rafael