I’m working on a web radio page. We use a very basic script to get the current song name from server:
$.get('http://test.gigsters.ru/whateva/icecastsstats/stats.php', function (data) {
$('#currently-playing').text(data);
});`
The page on which the code is used is here.
It works in Safari/FF/Chrome, but fails to do the job in IE (incl. 9) and Opera. I’ve also created a clean test page to test if IE&Opera fail to get the data at all. But there the script functions all right.
I tried browser debuggers, they don’t seem to be of a reasonable help.
Thanks in advance!
Not that I solved it, but the problem was that the script was located in the main domain (gigsters.ru) and the php file on subdomain (test.gigsters.ru). Somehow nor IE or Opera follow the same-domain policy more strictly (or less maybe? why other browsers allow for this then?).
Placed in the test.gigsters.ru zone, same as get’ted PHP script, the JS code started working correctly.
By the way, i tried to play with getJSON and getJSONP, but to no avail.