Help with Ajax..
Hi all! Could anyone tell me why this wont work...
The function works when i remove the (ver) after "stateChanged" (inside showCat function). What I'm doing is I want to use this function more than once, so Im combining PHP to throw in a variable in showcat(str,ver). The ver is where the integer goes and auto-increments using a for loop that is being called through PHP
This is my PHP... (which works fine)..
<select name="blah" onchange="showCat(ver,$i)">
... however the ajax wont work!
alert ("Browser does not support HTTP Request")
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
else if (window.ActiveXObject)
Thanks, but it didn't really help me :(
I want to use this function again and again and display the text in a diff element each time.. eg. txtHint1, txtHint2, txtHint3.. thats why im adding +ber to getElementByID("txtHint"+ber);
That explained that this:
should be this:
That's not your only problem though. You don't seem to realize that the number outputted by the PHP will only be incremented when the page reloads.
I didn't post all of my PHP, but it works fine. The AJAX was my difficulty, I'm pretty new to it. I grabbed this code from a tutorial, but with that added suggestion you made, it all works!
Thank you very much!