Hey,
I asked a question yesterday on how to make a radio updater. People responded with telling me to use Ajax. I’ve seen it in use, and figured they were right and should try it out. I’ve ran into a few questions though that I’m hoping someone can help me with.
I’ve learned that Ajax largely uses the XMLHttpRequest function. My main question though, is how to use this to check what a current php variable is. I want a way for Ajax to check a current php variable, and if its changed from 0 to 1 or 1 to 0, I want the page to be updated to display a different html code.
Another question which kinda links in with the above, is how to have the ajax distinguish whether the current php variable is different than its last check. I really am lost when it comes to Ajax.
An Ajax script that kinda does this:
Radio Online —Ajax Check, Variable Changed–> Refresh to backup music —Ajax Check, No Variable Change–> Page doesn’t refresh —Ajax Check, Variable Change–> Refresh to Radio
Thats pretty much what I’m trying to do, and I just have no idea what I need to use, besides the XMLHttpRequest function.
Any insight on this would be great!
Thanks in advance for any help.