23309ef43b98e7321865dd86b80368086683cb67
[aaf/authz.git] / auth / auth-gui / theme / onap / comm.js
1 function http(meth, sURL, sInput, func) {
2         if (sInput != "") { 
3                 var http;
4                 if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari
5                   http=new XMLHttpRequest();
6                 } else {// code for IE6, IE5
7                   http=new ActiveXObject('Microsoft.XMLHTTP');
8                 }
9         
10                 http.onreadystatechange=function() {
11                   if(http.readyState==4 && http.status == 200) {
12                          func(http.responseText)
13                   }
14                   // Probably want Exception code too.
15                 }
16                 
17                 http.open(meth,sURL,false);
18                 http.setRequestHeader('Content-Type','text/plain;charset=UTF-8');
19                 http.send(sInput);
20         }
21 }