salve , ho un problema ...
ho creato questa funziona per lanciare un refresh "nascosto" di una sezione della mia pagina
nella mia pagina divisa cosiCodice PHP:
<script language="javascript">
function createRequestObject() {
var req;
if(window.XMLHttpRequest){
// Firefox, Safari, Opera...
req = new XMLHttpRequest();
} else if(window.ActiveXObject) {
// Internet Explorer 5+
req = new ActiveXObject("Microsoft.XMLHTTP");
} else {
// There is an error creating the object,
// just as an old browser is being used.
alert("Your Browser Does Not Support This Script - Please Upgrade Your Browser ASAP");
}
return req;
}
// Make the XMLHttpRequest object
var http = createRequestObject();
function sendRequest(page) {
// Open PHP script for requests
http.open('get', page);
http.onreadystatechange = handleResponse;
http.send(null);
}
function handleResponse() {
if(http.readyState == 4 && http.status == 200){
// Text returned FROM the PHP script
var response = http.responseText;
if(response) {
// UPDATE ajaxTest content
document.getElementById("azioni").innerHTML = response;
}
}
}
function aggiornaajax()
{
sendRequest('member.php'); // replace "inbox-status.php" with your php page's url
}
</script>
<div id="main">
<div id="header">
<div id="azioni"></div>
</div></div>
ho messo un bottone che lancia appunto la funziona aggiornaajax , funziona tutto benissimo...
se nn fosse per il fatto che dentro il box azioni mi aggiorna le azioni ma includendo anche main e header , quindi mi ritrovo
<div id="main">
<div id="header">
<div id="azioni">
<div id="main">
<div id="header">
<div id="azioni"></div>
</div></div>
</div>
</div></div>
sapete il perchè ??

Rispondi quotando
