/* * DON'T REMOVE THE FOLLOWING LICENSE * INFORMATION! * ---------------------------------- * Copyright by * Global Cube Business Solutions * Author: Dennis Ritz * info@global-cube.de * 2007-2008 * ---------------------------------- */ function Ajax() { var _method = "POST"; var _requests = new Array(); var _finished = 0; var _timeout = 30; //var _url = window.location.protocol+"//"+window.location.host+":"+window.location.port+"/"+window.location.pathname; var _url = window.location.protocol+"//"+window.location.host+window.location.pathname; function request(p_class,p_fcnName) { var args = new Array(); for(var i=0; iStatus: FAILURE (unexpected response format)
Evaluate status: NOT EXECUTED
' + txt); } else { var data = txt.substring(2); try { var callback; var calldata = false; if (typeof args[args.length-1] == "object") { callback = args[args.length-1].callback; calldata = args[args.length-1].calldata; } else { callback = args[args.length-1]; } callback(eval(data), calldata); Log.notice('AJAX REQUEST RESPONSE
Response status: OK
Evaluate status: OK
' + txt); } catch (e) { Log.error('AJAX REQUEST RESPONSE
Response status: OK
Evaluate status: FAILURE (' + e + ')
' + txt); } } var sajax_active = false; var k = _finished; for(var i=0; i<_requests.length;i++) { if(_requests[i].readyState != 4){ sajax_active = true; } } if(!sajax_active){ _requests = new array(); Browser.setDisplay(Browser.getElementById("retrieve"),false); } } } Log.notice('AJAX REQUEST\nRequest function: ' + p_className + '->' + p_fcnName + '\nRequest type: ' + _method + '\nRequest URL: ' + _url + '\nRequest data: ' + postData + '\n\nWaiting for response...\nPress "OK" to continue.'); x.send(postData); delete x; return true; } this.call = call; function initObject() { var A; var msxmlhttp = new Array( 'Msxml2.XMLHTTP.5.0', 'Msxml2.XMLHTTP.4.0', 'Msxml2.XMLHTTP.3.0', 'Msxml2.XMLHTTP', 'Microsoft.XMLHTTP'); for (var i = 0; i < msxmlhttp.length; i++) { try { A = new ActiveXObject(msxmlhttp[i]); } catch (e) { A = null; } } if(!A && typeof XMLHttpRequest != "undefined") A = new XMLHttpRequest(); if (!A) Log.warning('Ajax:initObject\nCould not create connection object.'); return A; } this.initObject = initObject; this.log = function log(){ } } var Ajax = new Ajax();