Check whether channel is online or not via js [SOLUTION FOUND]

Alright guys, thank you very much for your answers.

Final piece of code that seems to work, in case anybody will stumble upon this page while googling for the same problem. Idea was to display different images of Twitch channel logo depending on status is LIVE or not, and existing wordpress plugins or other solutions were not suited for me, because I wanted exact image with exact size.

<script src="http://code.jquery.com/jquery-1.11.2.min.js"></script>
<script>
$.getJSON('https://api.twitch.tv/kraken/streams/Jonathan_x64', function(channel) {

    if (channel["stream"] == null) { 
        window.alert("nie wow");

    } else {
        window.alert("wow");
    
    }
});
</script>

window.alert here must be replaced with document.write() or similar function. “wow” is displayed when stream is online.

/thread