What's the right way to use the arguments property of a function? This is how I'm currently using it, but I'm pretty sure I'm not using it correctly:
First, I define my parameters:
parameters = {};
parameters.ID = $tr.data('ID');
parameters.Name = 'Name goes here';
parameters.td = $td;
UpdateName(parameters);
And in the function:
var UpdateName = function(){
var local = {};
local.ID = arguments[0].ID;
local.Name = arguments[0].Name;
local.td = arguments[0].td;
local.jqXHR = $.ajax('Remote/Ajax.cfc', {
data: {
method:'UpdateName'
,returnformat:'json'
,ID:local.ID
,Name:local.Name
}
});
local.jqXHR.success(function(result){
if (result.MSG == '') {
local.td.text(local.Name).addClass('success');
} else {
local.td.addClass('err');
};
});
local.jqXHR.error(function(result){
local.td.addClass('err');
});
}
$.ajax.