> This works for me:
>
> $.ajax({
> url: 'email.pl',
> type: "post",
> data: {
> rm: 'deleteLetter',
> ID: myForm.letterSelect.value
> },
> dataType: 'json',
> success: function( ret ) {
> alert( ret.a );
> }
> });
>
> I believe the order in which you pass the params to $.ajax matters.
There's only one argument being passed to $.ajax, a single object literal.
To illustrate, you could write the code like this:
var args = {
url: 'email.pl',
type: "post",
data: {
rm: 'deleteLetter',
ID: myForm.letterSelect.value
},
dataType: 'json',
success: function( ret ) {
alert( ret.a );
}
};
$.ajax( args );
The order of properties in an object literal doesn't matter, except possibly
in a couple of pathological cases [1] [2] that don't apply here.
-Mike
[1] If a property name is used twice in the same object literal - which one
wins?
[2] If the receiving code does "for( name in argobject )" and assumes a
particular order of enumeration (which is undefined behavior anyway).
_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/