Changeset 665 for trunk/expressoCalendar/js/connector.js
- Timestamp:
- 02/06/09 08:41:18 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/expressoCalendar/js/connector.js
r632 r665 95 95 } 96 96 var connector = new cConnector(); 97 97 function _xml() 98 { 99 var a = false; 100 if ( document.implementation.createDocument ) 101 a = document.implementation.createDocument("", "", null); 102 else if ( ActiveXObject ) 103 a = new ActiveXObject("Msxml2.DOMDocument"); 104 if ( arguments.length == 1 && typeof arguments[0] == 'string' ) 105 a.appendChild(a.createElement(arguments[0])); 106 return a; 107 } 98 108 XMLTools.prototype = { 99 109 "__DEBUG__" : false, … … 282 292 }; 283 293 294 function cExecuteForm(url, form, handler){ 295 connector.showProgressBar(); 296 var iframe_el = document.getElementById('nullFrame'); 297 if (!iframe_el) 298 { 299 iframe_el = document.createElement('IFRAME'); 300 iframe_el.id = "nullFrame"; 301 } 302 iframe_el.style.width = "0px"; 303 iframe_el.style.height = "0px"; 304 iframe_el.style.border = '0px'; 305 iframe_el.name = "nullFrame"; 306 iframe = document.body.appendChild(iframe_el); 307 iframe_el.setAttribute('onload', 'javascript:'+handler+'()'); 308 form.target = "nullFrame"; 309 form.submit(); 310 } 311 312 function cExecute(requestURL,handler,methmd){ 313 var AjaxRequest = function () { 314 Ajax = false; 315 if (window.XMLHttpRequest) //Gecko 316 Ajax = new XMLHttpRequest(); 317 else 318 if (window.ActiveXObject) //Other nav. 319 try 320 { 321 Ajax = new ActiveXObject("Msxml12.XMLHTTP"); 322 } catch (e) 323 { 324 Ajax = new ActiveXObject("Microsoft.XMLHTTP"); 325 } 326 } 327 var responseRequest = function (){ 328 if (Ajax.readyState == 4) 329 if (Ajax.status == 200) 330 handler(Ajax.responseText); 331 else 332 alert("Erro temporario de conexão"); 333 } 334 335 336 AjaxRequest(); 337 if (!Ajax){ 338 alert("Erro ao conectar-se"); 339 return; 340 } 341 342 Ajax.onreadystatechange = responseRequest; 343 if (typeof(method) == 'undefined') 344 method = 'GET'; 345 Ajax.open(method, requestURL, true); 346 Ajax.send(null); 347 } 284 348 var XMLTools = new XMLTools(); 285 349 var xtools = new XTools;
Note: See TracChangeset
for help on using the changeset viewer.