I have found it helpful to output any JS errors with an alert on window.onerror ->
window.onerror = function(error) {
alert(error);
};
I paste that into the top of scripts so that any runtime errors will be output in a native alert. Works on desktop too.