jQuery serialize()没有在IE中加载Ajax的对话框 [英] jQuery serialize() not working on Ajax-loaded dialogues in IE

查看:86
本文介绍了jQuery serialize()没有在IE中加载Ajax的对话框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望这个网站上有人可以提供一些帮助。我有一个页面使用ajax将表单(id:editform)加载到jQuery-ui对话框中。对话框附有一个按钮 - 当有人更改表单并单击此按钮时,它会触发一个函数 serialize()表单数据并通过<$ c $发送c> $。发布用结果替换页面上的div。这在我测试的每个浏览器中工作正常,除了......等待它...... IE(所有版本)。问题似乎是IE无法识别序列化此表单的调用。

I'm hoping someone on this site can offer some help. I have a page that uses ajax to load a form (id: "editform") into a jQuery-ui dialog box. The dialog box has a button attached - when someone changes the form and clicks this button it triggers a function which serialize()s the form data and sends it via $.post to replace a div on the page with the results. This works fine in every browser I've tested on except...wait for it...IE (all versions). The problem seems to be that IE is not recognizing the call to serialize this form.

alert($("#editform").serialize());

在IE中给我,但在其他浏览器中给出了所需的长查询字符串。我也试图一次抓取一个数据,

gives me "" in IE, but the desired long querystring in other browsers. I've also tried to grab the data one piece at a time,

alert($("#name").val());

再次 - IE无法识别此字段,返回而其他浏览器输出数据I'我正在寻找。

Again - IE does not recognize this field, returning "" while the other browsers output the data I'm looking for.

任何想法?

谢谢

推荐答案

好的 - 我找到了。谢谢,Brandon H.指出我的HTML - 我没有关闭生成的HTML中的表单(),这显然是绊倒了IE。我现在就开始运行了。

Okay - I found it. Thanks, Brandon H. for pointing me to the HTML - I hadn't closed the form () in the generated HTML, which was apparently tripping up IE. I got it up and running now.

非常感谢您的时间。

这篇关于jQuery serialize()没有在IE中加载Ajax的对话框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆