Hi I'm doing a website which contains several radios. I need to know, through javascript, if a radio stream url is working or not. I achieve this in PHP doing a file_get_contents($radio_source, false, NULL, -1, 600);
, doing this I know that if the request reached the limit (600) then the request is alive, otherwise, not. My question is: Does exist a way to do this in Javascript?. So far, $.ajax doesn't seems to be an option, because doesn't have any parameter to help me to achieve this.
You can use this cool function built for javascript: https://github.com/kvz/phpjs/blob/master/functions/filesystem/file_get_contents.js . That uses XMLHttpRequest