02-23-2008, 05:11 AM
|
#1 (permalink)
|
|
The Addict
Join Date: Nov 2007
Location: USA
Posts: 256
Thanks: 7
|
AJAX Help
My whole 3 hours of ajax experince has hit a brick wall. I am able to get the data i want through the ajax but i cannot get it to update the display of the page. Heres what i am trying to use.
Code:
//strait from w3schools.com
//well almost i changed a little.
<script type="text/javascript">
function ajaxFunction(){
var xmlHttp;
try {
xmlHttp=new XMLHttpRequest();
} catch (e) {
try {
xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
} catch(e) {
try{
xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
} catch (e) {
alert("Your browser does not support AJAX!");
return false;
}
}
}
xmlHttp.onreadystatechange=function() {
if(xmlHttp.readyState==4) {
alert(xmlHttp.responseText);
document.getElementByName('guide1')=xmlHttp.responseText;
}
}
xmlHttp.open("GET","test.php",true);
xmlHttp.send(null);
}
</script>
And my call to the function.
Code:
echo "<h7 name=\"guide1\">8</h7><a href=\"#\" onClick=\"ajaxFunction()\">+ Guide</a>...
All the test.php does is output the word done. and when i click on my link here the alert box says done. but the h7 tag will not update. Any ideas where im screwing up?
|
|
|
|