sg481n | bd890c5 | 2017-08-28 12:11:35 -0400 | [diff] [blame^] | 1 | /******************************************************************************* |
| 2 | * Copyright (c) 2016 AT&T Intellectual Property. All rights reserved. |
| 3 | *******************************************************************************/ |
| 4 | function http(meth, sURL, sInput, func) { |
| 5 | if (sInput != "") { |
| 6 | var http; |
| 7 | if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari |
| 8 | http=new XMLHttpRequest(); |
| 9 | } else {// code for IE6, IE5 |
| 10 | http=new ActiveXObject('Microsoft.XMLHTTP'); |
| 11 | } |
| 12 | |
| 13 | http.onreadystatechange=function() { |
| 14 | if(http.readyState==4 && http.status == 200) { |
| 15 | func(http.responseText) |
| 16 | } |
| 17 | // Probably want Exception code too. |
| 18 | } |
| 19 | |
| 20 | http.open(meth,sURL,false); |
| 21 | http.setRequestHeader('Content-Type','text/plain;charset=UTF-8'); |
| 22 | http.send(sInput); |
| 23 | } |
| 24 | } |