Hey there DaniWeb, Recently i found out that there was a thing that didn't work in my CMS.
Code (index.php):
<body onLoad=\"javascript:loadManageNews();loadManageNav();loadMCE();\"> (in a PHP file)
Issue: It calls the loadManageNews() function just finse but it doesn't call the loadManageNav(). It also loads the loadMCE() function just fine. And yes there is a function named loadManageNav() and the ajax.js file is included.
Code (ajax.js):
function refresh() {
window.location = 'index.php';
}
function update() {
document.getElementById("answer").innerHTML="<img src='./images/updating.gif' />";
if (window.XMLHttpRequest) {
xmlhttp=new XMLHttpRequest();
}
else {
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange=function() {
if (xmlhttp.readyState==4 && xmlhttp.status==200) {
setTimeout('refresh()',1000);
document.getElementById("answer").innerHTML=xmlhttp.responseText;
}
}
xmlhttp.open("POST","./process/update.php",true);
xmlhttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
xmlhttp.send("version=" + document.getElementById("version").value + "&version1=" + document.getElementById("version1").value);
}
function loadManageNews() {
document.getElementById("manage").innerHTML='Loading...';
if (window.XMLHttpRequest)
{
xmlhttp=new XMLHttpRequest();
xmlhttp.open("GET","./process/managen.php",false);
xmlhttp.send(null);
}
else
{
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
xmlhttp.open("GET",url,false);
xmlhttp.send();
}
document.getElementById("manage").innerHTML=xmlhttp.responseText;
xmlhttp = null;
}
function loadManageNav() {
document.getElementById("managenav").innerHTML='Loading...';
if (window.XMLHttpRequest)
{
xmlhttp=new XMLHttpRequest();
xmlhttp.open("GET","./process/managenav.php",false);
xmlhttp.send(null);
}
else
{
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
xmlhttp.open("GET",url,false);
xmlhttp.send();
}
document.getElementById("managenav").innerHTML=xmlhttp.responseText;
xmlhttp = null;
}
function delNews(id) {
confirm = confirm("You are just about to delete the news post with id " + id + ".");
if(confirm) {
if (window.XMLHttpRequest) {
xmlhttp=new XMLHttpRequest();
}
else {
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange=function() {
if (xmlhttp.readyState==4 && xmlhttp.status==200) {
wackoo("./process/managen.php","manage");
}
}
xmlhttp.open("GET","./process/deleten.php?id=" + id,true);
xmlhttp.send();
}
else {
}
delete confirm;
}
there you go...
and yes the ./process/managenav.php file exists and it outputs just fine if i go to the file alone.
Please help.