Wavestreaming/jquery-shoutcast — pull request #9 by Mostafa-Samir (2014-10-01 02:38:31+00:00)
Title: Fixed 'onerror' bug

So I wrote some code in the stats function that handles the situation in which the station is off air, and I wanted to test it so I stopped the server and as a result, the stats page on the server went down (so the plugin will fail to connect). When I returned to the code I found that it's not working and it kept throwing TypeError: Undefined is not a function.

after some digging up in the code, I found that the callback for the onerror event of the ajax request , which is fired when the connection fails, calls SHOUTCast.prototype.stats in the end instead of calling the _stats method that holds the user defined stats function or the default function. and that's what caused the problem.

And here we are :smiley: