make arg name ambiguous / misleading

This commit is contained in:
James Campos 2012-06-12 11:15:00 -07:00
parent ab94fcfb79
commit 51e6aae640
2 changed files with 9 additions and 9 deletions

View File

@ -324,13 +324,13 @@
return fd;
},
ajax: function(url, callbacks, opts) {
var data, headers, key, r, type, upCallbacks, val;
var form, headers, key, r, type, upCallbacks, val;
if (opts == null) {
opts = {};
}
type = opts.type, headers = opts.headers, upCallbacks = opts.upCallbacks, data = opts.data;
type = opts.type, headers = opts.headers, upCallbacks = opts.upCallbacks, form = opts.form;
r = new XMLHttpRequest();
type || (type = data && 'post' || 'get');
type || (type = form && 'post' || 'get');
r.open(type, url, true);
for (key in headers) {
val = headers[key];
@ -338,7 +338,7 @@
}
$.extend(r, callbacks);
$.extend(r.upload, upCallbacks);
r.send(data);
r.send(form);
return r;
},
cache: function(url, cb) {
@ -2067,7 +2067,7 @@
}
};
opts = {
data: data,
form: data,
upCallbacks: {
onload: function() {
return QR.status({

View File

@ -274,15 +274,15 @@ $.extend $,
fd.append key, val
fd
ajax: (url, callbacks, opts={}) ->
{type, headers, upCallbacks, data} = opts
{type, headers, upCallbacks, form} = opts
r = new XMLHttpRequest()
type or= data and 'post' or 'get'
type or= form and 'post' or 'get'
r.open type, url, true
for key, val of headers
r.setRequestHeader key, val
$.extend r, callbacks
$.extend r.upload, upCallbacks
r.send data
r.send form
r
cache: (url, cb) ->
if req = $.cache.requests[url]
@ -1569,7 +1569,7 @@ QR =
target: '_blank'
textContent: 'Connection error, or you are banned.'
opts =
data: data
form: data
upCallbacks:
onload: ->
# Upload done, waiting for response.