![]() |
|
|
#1 |
![]() Join Date: Oct 2006
Location: St. Louis, MO
Posts: 554 (0.23/day)
Thanks: 51
Thanked 35 Times in 28 Posts
|
Very simple script in AJAX doesn't work...
I have been trying my hardest, but no matter what, nothing I code with AJAX works
.Here is a very, very simple script just to get the time from a PHP file I have, that echoes the time, and put it in a text box called "timebox". It puts "undefined" in the box instead. I know for a fact fro my servers 404 logs that it is getting all the files it needs, but still. Lets just assume that who ever is accessing the page is using Firefox. I'll change it after I get it to work. Code:
<script type='text/javascript'>
function time()
{
var http = new XMLHttpRequest();
http.onreadystatechange=function()
{
if (http.readyState==4)
{
document.time.timebox.value=http.responceText;
}
}
http.open("GET","../libs/time.php", true);
http.send(null);
}
</script>";
<form name='time'><input type='text' name='timebox'><input type='button' value='Server Time' name='timebutton' onclick="document.location.href='javascript:time();'"></form>
Chris
__________________
|
|
|
|
|
|
#2 |
![]() Join Date: Oct 2006
Location: St. Louis, MO
Posts: 554 (0.23/day)
Thanks: 51
Thanked 35 Times in 28 Posts
|
Ok, it's fixed. another member on a another forum caught a spelling error in "response".
Chris
__________________
|
|
|
|
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Overclocking is Easy! Get Results! | Kursah | Overclocking & Cooling | 131 | May 12, 2010 12:14 AM |
| Good Work Systems Fragpedal Elite | Darksaber | Reviews | 3 | Jul 30, 2007 12:02 PM |
| Violate the laws of physics:Windows Vista DRM | SpoonMuffin | General Software | 43 | Jan 19, 2007 02:46 AM |
| this bios work fine ??? | Giux-900 | Graphics Cards | 2 | Jan 5, 2006 05:12 AM |