Portal Home > Knowledgebase > Articles Database > Problem with my ajax script


Problem with my ajax script




Posted by latheesan, 09-25-2007, 03:48 PM
Hello. Following this tutorial, http://www.w3schools.com/ajax/ajax_example_suggest.asp, i wrote a ajax function in javascript, so itcan be used to call different .php file and write response inside the given span/div ID The code looks like this: This is how i tried to use the above function. On my index.php i have this: and here is the test.php inside my "ajax_serve" folder So, when i clicked on the test link, nothing appeared in the and i saw his error in the internet explorer: http://img401.imageshack.us/img401/6825/untitledqx5.jpg Can someone help me figure out where i am going wrong? It'd be much appreciated. Thanks. Last edited by latheesan; 09-25-2007 at 03:57 PM.

Posted by sasha, 09-25-2007, 06:42 PM
Try replacing this: xmlHttp.onreadystatechange=stateChanged(id); with this: xmlHttp.onreadystatechange=function () { stateChanged(id); }

Posted by latheesan, 09-25-2007, 08:28 PM
oh my, thanks allot, it worked ^_^



Was this answer helpful?

Add to Favourites Add to Favourites    Print this Article Print this Article

Also Read
Netfirms service down? (Views: 700)
ServInt (Views: 933)
solve my php problems (Views: 651)

Language: