added ability to use ajax without jquery

This commit is contained in:
coderaiser 2012-08-31 11:03:58 -04:00
parent ddfe1498a2
commit 7a47780308
2 changed files with 19 additions and 1 deletions

View file

@ -8,6 +8,8 @@ was empty, we could not go in.
* Removed packed versions of files, uglifing
would be doing on-a-fly
* Added ability to use ajax without jquery.
2012.08.24, Version 0.1.6

View file

@ -135,7 +135,23 @@ CloudClient.Utils = (function(){
* jquery could be droped out
*/
this.ajax = function(pParams){
$.ajax(pParams);
if($)
$.ajax(pParams);
else{
var xmlhttp;
xmlhttp = new XMLHttpRequest();
var lMethod = 'GET';
if(pParams.method)
lMethod = pParams.method;
xmlhttp.onreadystatechange = function(){
xmlhttp.open(lMethod, pParams.url, true);
xmlhttp.send(null);
};
}
};
/* setting function context (this) */