I have a pretty robust JavaScript script that controls my room lights via some external software. I have a PHP that when run returns only a 1 or a 0. I ideally want to have a JavaScript loop that runs every couple seconds and pulls that 1 or 0 and if it is a 1, do some work. Problem is, can't figure out how to get the JavaScript to open another page in terms or processing/data collection.
Is there a "file get contents" equal to JavaScript? I don't want the PHP values written on the JavaScript page, just to have the value to do a little if statement.