diff options
Diffstat (limited to '')
| -rw-r--r-- | ajax.js | 47 |
1 files changed, 0 insertions, 47 deletions
diff --git a/ajax.js b/ajax.js deleted file mode 100644 index 7b7bec3..0000000 --- a/ajax.js +++ /dev/null | |||
| @@ -1,47 +0,0 @@ | |||
| 1 | function getP(host, plugin) { | ||
| 2 | getData(host, plugin, 'load'); | ||
| 3 | } | ||
| 4 | |||
| 5 | function rmP(host, plugin) { | ||
| 6 | getData(host, plugin, 'del'); | ||
| 7 | } | ||
| 8 | |||
| 9 | var xmlHttp | ||
| 10 | |||
| 11 | function getData(obj, id, action) { | ||
| 12 | xmlHttp=GetXmlHttpObject(); | ||
| 13 | if (xmlHttp==null) { | ||
| 14 | alert ("Your browser does not support AJAX!"); | ||
| 15 | return; | ||
| 16 | } | ||
| 17 | |||
| 18 | var url="plugin.php"; | ||
| 19 | url=url+"?h="+obj+"&p="+id+"&a="+action; | ||
| 20 | xmlHttp.onreadystatechange=function(){setData(id)} | ||
| 21 | xmlHttp.open("GET",url,true); | ||
| 22 | xmlHttp.send(null); | ||
| 23 | } | ||
| 24 | |||
| 25 | function setData(obj) { | ||
| 26 | if (xmlHttp.readyState==4) { | ||
| 27 | div = document.getElementById(obj); | ||
| 28 | |||
| 29 | div.innerHTML=xmlHttp.responseText; | ||
| 30 | } | ||
| 31 | } | ||
| 32 | |||
| 33 | function GetXmlHttpObject() { | ||
| 34 | var xmlHttp=null; | ||
| 35 | try { | ||
| 36 | // Firefox, Opera 8.0+, Safari | ||
| 37 | xmlHttp=new XMLHttpRequest(); | ||
| 38 | } catch (e) { | ||
| 39 | // Internet Explorer | ||
| 40 | try { | ||
| 41 | xmlHttp=new ActiveXObject("Msxml2.XMLHTTP"); | ||
| 42 | } catch (e) { | ||
| 43 | xmlHttp=new ActiveXObject("Microsoft.XMLHTTP"); | ||
| 44 | } | ||
| 45 | } | ||
| 46 | return xmlHttp; | ||
| 47 | } | ||
