JQuery 对话框 / submit() 在 IE8 中不起作用
JQuery dialog / submit() not working in IE8
适用于除IE8以外的任何地方。提交永远不会触发。我尝试取出对话框并离开提交,但在IE8中仍然没有任何反应。
Javascript:
$(function () {
$("#fileUpload").click(function () {
$("#fileButton").click();
});
});
$(function () {
$("#fileButton").change(function () {
$("#dialogUploading").dialog({
dialogClass: 'no-close',
modal:true,
async:true
});
$("#formSubmit").submit();
});
});
.HTML:
using (Html.BeginForm("ReferralUpload", "ReferralNetwork", FormMethod.Post, new { enctype = "multipart/form-data", id = "formSubmit", style = "display:inline" }))
{
<input type="file" id="fileButton" name="fileButton" style="display:none" />
<button type="button" id="fileUpload" style="width:250px;">Upload Referrals</button>
}
有什么想法吗?谢谢!
您可以尝试将$("#fileButton").change(function () {
更改为$("#fileButton").change(function (e) {
,看看这是否有区别吗? 我认为IE需要传递事件才能快乐。
哦,对$("#fileUpload").click(function () {
做同样的事情$("#fileUpload").click(function (e) {
确保你使用的是正确版本的jQuery。版本 2 及更高版本与 IE8 不兼容。
http://jquery.com/browser-support/
经过进一步的研究,我发现它无法完成 jQuery:模拟对 的点击在 Firefox 中不起作用?并非没有一些黑客行为。在 IE8 中,无法以编程方式单击文件输入,否则无法提交。一个技巧是将不透明度设置为零并在按钮上显示图像:http://www.quirksmode.org/dom/inputfile.html
相关文章:
- Recaptcha在IE7和IE8中不起作用
- 在IE8中不起作用的元素上触发单击事件
- 数据-在IE8中不起作用
- getComputedStyle替换:currentStyle(IE8/7)不起作用
- IE8 jquery ajax头请求不起作用
- 显示隐藏的html表在javascript(IE8)中不起作用
- ScriptX 打印功能在 IE8 中不起作用
- Angularjs 跨源资源共享 (CORS) 发布或放置方法在 IE8 和 IE9 中不起作用
- ExtJs 5.0:forEach on Array of Objects在IE8中不起作用
- 将JSON对象转换为敲除observable在IE8中不起作用,但在所有其他浏览器中都起作用
- 聚焦函数在ie8中不起作用
- 启动网格在IE8中不起作用
- Svg标签在IE8中不起作用
- Twitter引导程序示例在IE8中不起作用
- 引导程序3在IE8中不起作用(已检查其他答案)
- IE8的Javascript占位符不起作用
- Javascript中的开关案例在IE8中不起作用
- 如果我添加 pageX 页面 Y 在 IE8 中不起作用<!文档类型 html>.
- getElementsByTagName和getElementsByClassName在IE8中不起作用
- 导航在IE8上不起作用