/* * xhr.js - utility functions * * author: hackbard@hackdaworld.org * */ function xhr(type,url,data,cb) { var ao={ url: url, type: type, success: function(ret) { cb(ret); } }; if((data!==undefined)&&(data!==null)) { if(typeof data != "string") ao.data=JSON.stringify(data); else ao.data=data; } $.ajax(ao); }