jQuery的序列化和serializeArray工作不与谷歌浏览器 [英] Jquery serialize and serializeArray is not working with google chrome
问题描述
我有以下的HTML。
<fieldset id="fieldset-step_3">
<input type="text" value="2" id="rule_form-lead_time" name="rule_form[lead_time]">
<select class="w50" id="rule_form-operator" name="rule_form[operator]">
<option label="<" value="<"><</option>
<option selected="selected" label=">" value=">">></option>
</select>
<button type="button" id="next" name="next">Next</button>
</fieldset>
我用下面的jQuery $ C $下获取值后,单击下一步按钮。
I use following jquery code for get values when click next button.
$('#next').click(function () {
var values = $('#fieldset-step_3').serialize();
alert(values);
});
这code工作为Firefox 8和歌剧11.60测试版。但它并不适用于谷歌浏览器15.0.874.121工作。
This code working for firefox 8 and opera 11.60 beta. But it does not work for google chrome 15.0.874.121.
请帮助我。给我另外一个想法从jQuery的GET现场设置值。
Please help me. Give me another idea for get field-set values from jquery.
推荐答案
您似乎已经找到了一个错误。我在Chrome 11尝试这样做,看到了同样的事情。如果我序列化的形式,它的工作原理。如果我个人的序列化表单元素,它的工作原理。如果我尝试序列包含所有的表单元素,或字段集标签的DIV,它没有。
You seem to have found a bug. I tried this in Chrome 11 and saw the same thing. If I serialize the form, it works. If I serialize individual form elements, it works. If I try to serialize a div containing all of the form elements, or your fieldset tag, it doesn't.
这篇关于jQuery的序列化和serializeArray工作不与谷歌浏览器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!