开发者

The following code doesn't works in IE but in opera and mozilla

开发者 https://www.devze.com 2023-03-12 02:02 出处:网络
This is the form <form action=\"post\" name=\"default_form\"> <input type=\"hidden\" value=\"d\" name=\"def\" />

This is the form

<form action="post" name="default_form">
    <input type="hidden" value="d" name="def" />
    <div id="load_result"></div>
  </form>

But the following code doesn't works in IE but properly works in mozilla,opera

var body = documen开发者_JAVA技巧t.forms.default_form.serialize();

Any idea?


The form element does not have a serialize() method.

It isn't in the HTML5 spec either.

If you are talking about jQuery's serialize(), then you need to wrap the matched set with the jQuery object $(document.forms.default_form) or even $('form[name="default_form"]').

0

精彩评论

暂无评论...
验证码 换一张
取 消