[ Index ] |
PHP Cross Reference of osCMax 2.0.4 |
[Summary view] [Print] [Text view]
1 /* 2 $Id: xmlhttp.js 1739 2007-12-20 00:52:16Z hpdl $ 3 4 osCMax Power E-Commerce 5 http://oscdox.com 6 7 Copyright 2008 osCMax 8 9 Released under the GNU General Public License 10 */ 11 12 var http; 13 14 function loadXMLDoc(url, functionCall) { 15 http = getHTTPObject(); 16 17 if (http) { 18 http.onreadystatechange = functionCall; 19 http.open("GET", url, true); 20 http.send(""); 21 } 22 } 23 24 function getHTTPObject() { 25 var xmlhttp; 26 27 /*@cc_on 28 @if (@_jscript_version >= 5) 29 try { 30 xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); 31 } catch (e) { 32 try { 33 xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); 34 } catch (E) { 35 xmlhttp = false; 36 } 37 } 38 @else 39 xmlhttp = false; 40 @end @*/ 41 42 if (!xmlhttp && typeof XMLHttpRequest != 'undefined') { 43 try { 44 xmlhttp = new XMLHttpRequest(); 45 } catch (e) { 46 xmlhttp = false; 47 } 48 } 49 50 return xmlhttp; 51 } 52 53 function getKeyCode(evt) { 54 if (evt) { 55 return evt.keyCode; 56 } 57 58 if (window.event) { 59 return window.event.keyCode; 60 } 61 } 62 63 function getEventSource(evt) { 64 if (evt) { 65 return evt.target; 66 } 67 68 if (window.event) { 69 return window.event.srcElement; 70 } 71 } 72 73 function cancelEvent(evt) { 74 if (evt) { 75 evt.preventDefault(); 76 evt.stopPropagation(); 77 } 78 79 if (window.event) { 80 window.event.returnValue = false; 81 } 82 } 83 84 function hideDiv(obj) { 85 if (obj.style.visibility == 'visible') { 86 obj.style.visibility = 'hidden'; 87 obj.style.display = 'none'; 88 } 89 } 90 91 function showDiv(obj) { 92 if (obj.style.visibility != 'visible') { 93 obj.style.visibility = 'visible'; 94 obj.style.display = 'inline'; 95 } 96 } 97 98 function isDivVisible(obj) { 99 return (obj.style.visibility == 'visible'); 100 } 101 102 function urlEncode(string) { 103 if (window.encodeURIComponent) { 104 return encodeURIComponent(string); 105 } 106 107 return escape(string); 108 } 109 110 function urlDecode(string) { 111 if (window.decodURIComponent) { 112 return decodeURIComponent(string); 113 } 114 115 return unescape(string); 116 }
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
Generated: Fri Jan 1 13:43:16 2010 | Cross-referenced by PHPXref 0.7 |