Is jQuery serialize () ordering of form data?
I have a series of inputs representing various forms:
<form id="myform">
<div id="item1">
<label> Name </label><input name="item1" type="text" value=""/>
</div>
<div id="item2">
<label> Name </label><input name="item2" type="text" value=""/>
</div>
<div id="item3">
<label> Name </label><input name="item3" type="text" value=""/>
</div>
</form>
<script>
$.post("/url/", $("#myform").serialize(), function(){});
</script>
When a message occurs, is it guaranteed that I will receive the data that it represents on the form? I tested it and it returned item1, item2, item3 in that order, but can this be assumed?
+4
3 answers
This is a difficult question. The documentationserialize says nothing about order, but says:
... creates a text string in standard encoding with URL encoding.
RFC for this RFC 1867 notation , states:
, , .
, , , jQuery , " URL" RFC , . ( , jQuery ), , .
+4