[Beginner] Basic Twitch website integration

Okey guys i think i have got soething going. However im running into an error.

The user Sjopele gave me some excellent help in PM’s.
This is the first jquery code he gave me.

function streamcheck()
{
$.post(“streamcheck.php”, function(data)
{
if(data == “online”)
{
online();
}
else if(data == “offline”)
{
offline();
}
});
};

function online()
{
$(function(){
$(‘i.fa fa-twitch’).addclass(‘animation pulse’)
});
}

function offline()
{
$(function(){
$(‘i.fa fa-twitch’).removeclass(‘animation pulse’)
});
}

$(document).ready(function()
{
streamcheck();
});

This peice of code runs another file called streamcheck.php located in the same javascript folder.
And here it is.

<?php

$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_RETURNTRANSFER => 1,
CURLOPT_URL => ‘https://api.twitch.tv/kraken/streams/zeracheilgames
));
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
$response = curl_exec($curl);
$checkkey = “language” ;
$position = strpos($response,$checkkey);

curl_close($curl);

if ($position === false)
{
echo “offline”;
}
else
{
echo “online”;
}

?>

But the problem remains, and i get this error in Chrome console.

XMLHttpRequest cannot load file:///C:/Users/Rasmus/Google%20Drive/HTML/Casey/streamcheck.php. Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https, chrome-extension-resource.

Does anyone know what the error might be?

Thanks again to the user Sjopele who wrote all this and explained it in a way i could understand.