我有一个
HTML文档,它使用AJAX调用从
PHP文件加载内容.我的代码的重要位置如下:
default.html:
/*more code above*/ var PHP_URL = "content.PHP"; var Content = document.getElementById('Content'); ajaxRequest = new XMLHttpRequest(); ajaxRequest.onreadystatechange = function() { if(ajaxRequest.readyState==4) { if (ajaxRequest.status==200) Content.innerHTML = ajaxRequest.responseText; else Content.innerHTML = "Error:<br/>unable to load page at <b>"+PHP_URL+"</b>"; Content.className = "Content Solid"; } } ajaxRequest.open("GET",PHP_URL,true); ajaxRequest.send(); /*more code below*/
“content.PHP”上的文件是否可以检测到它已从“default.html”调用,还是根据需要调用不同的调用文件?