added jsonp to resources

This commit is contained in:
Misko Hevery
2010-07-22 11:18:32 -07:00
parent b5bbfaeb80
commit 849a05b5a5
9 changed files with 125 additions and 21 deletions

View File

@@ -28,6 +28,7 @@ Route.prototype = {
query.push(encodeURI(key) + '=' + encodeURI(value));
}
});
url = url.replace(/\/*$/, '');
return url + (query.length ? '?' + query.join('&') : '');
}
};
@@ -88,7 +89,7 @@ ResourceFactory.prototype = {
throw "Expected between 0-3 arguments [params, data, callback], got " + arguments.length + " arguments.";
}
var value = action.isArray ? [] : new Resource(data)
var value = action.isArray ? [] : new Resource(data);
self.xhr(
action.method,
route.url(extend({}, action.params || {}, extractParams(data), params)),