【发布时间】:2012-12-03 10:37:31
【问题描述】:
所有,
我发现我无法使用 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 标签行:
<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”,都失败了。
有人可以帮忙吗?非常感谢。
【问题讨论】:
-
如果
form action错了,那么它不会去任何地方。 -
其实我在我的页面中使用了正确的action,在Chrome/FireFox下可以提交,在IE下不行。这里不正确的操作仅用于示例。
标签: jquery forms internet-explorer jquery-mobile