全部,
我发现我无法使用JQueryMobile 1.2在Internet Explorer 8中手动提交表单。
下面是HTML代码,简单:
<HTML>
<HEAD>
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Expires" CONTENT="-1">
<META http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Test</title>
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.css" />
<script src="http://code.jquery.com/jquery-1.8.2.min.js"></script>
<script src="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.js"></script>
</head>
<body>
<form method="post" name="test" action="http://www.baidu.com/" data-ajax="false">
<input type="text" id="id_0" name="id_0" size="20" maxlength="32" value="PLAY"/>
<input type="text" id="id_1" name="id_1" size="20" maxlength="32" value="PLAY"/>
<input data-theme="b" type="submit" value="OK" id="basicSubmit"/>
</form>
</body>
</html>
我将此页面保存到本地磁盘,然后在Internet Explorer 8中打开它,它将显示2个文本和一个提交按钮。但是,当单击“确定”按钮时,什么也没有发生。
如果我删除脚本标记行,其中包括jquery.mobile-1.2.0.min.js:
<script src="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.js"></script>
并且jquerymobile样式消失了(没关系),“确定”按钮变为可点击状态以提交。 (尽管此表单的URL不正确,IE会显示错误消息)。我也尝试了“ data-ajax = true”或“ data-ajax = false”,都失败了。
有人可以帮忙吗?非常感谢。
我在IE9中无法使用“提交”按钮遇到同样的问题。我将提交按钮替换为
<input type="button" id="Signup" value="Signup!" data-role="" onClick="submitForm()">
并添加了功能:
function submitForm() {
document.registerForm.submit();
}
这解决了我的问题。
请参考this link。仅在您必须对该页面中提供的CSS进行一些更改的情况下,以上链接才解决此问题。