mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 10:45:47 +00:00
added ability to use ajax without jquery
This commit is contained in:
parent
ddfe1498a2
commit
7a47780308
2 changed files with 19 additions and 1 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
18
client.js
18
client.js
|
|
@ -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) */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue