"use strict"; console.log("testajax.php"); (function(){ let time = "2026-10-11 09:11:46 v4"; var cscript = document.currentScript; function GET() { var url_server = cscript.src; var xhr=new XMLHttpRequest(); xhr.open("GET",url_server,true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8"); xhr.setRequestHeader('Cache-Control', 'max-age=0'); xhr.addEventListener("load",function(){ if ( xhr.status == 200 ) { console.log(xhr.responseText); } else { var s = ""; s += "status:" + xhr.status + "\n"; s += "statusText:" + xhr.statusText; console.log(s); } }); xhr.send(); }; var CTestAjax = { init : function() { let _this = this; let el_output = document.querySelector(".output"); el_output.innerHTML = time; GET(); }, main : function() { var _this = this; window.addEventListener("load", function(event) { _this.init(); }); } }; CTestAjax.main(); })();