projects
/
outofuni
/
jsutils.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
initial checkin of jsutils
[outofuni/jsutils.git]
/
xhr.js
1
/*
2
* xhr.js - utility functions
3
*
4
* author: hackbard@hackdaworld.org
5
*
6
*/
7
8
function xhr(type,url,data,cb) {
9
var ao={
10
url: url,
11
type: type,
12
success: function(ret) {
13
cb(ret);
14
}
15
};
16
if((data!==undefined)&&(data!==null)) {
17
if(typeof data != "string")
18
ao.data=JSON.stringify(data);
19
else
20
ao.data=data;
21
}
22
$.ajax(ao);
23
}
24