I would like to know if there is something in JavaScript that loads the contents of a given file.
For example, I have a file called timer.php
which (on certain conditions) prints either a 1 or a 0. I need JavaScript to read it and use it as a variable in order to execute a function.
So something like:
function dothis() {
var timer = getfilecontents(timer.php);
if(timer == 1) {
somefunction();
}
}
And thats pretty much it. Is there anything I can use in the cases like this?