I have a script of audioplayer, I need to replace it to play/pause icons in mobile version and I did it, but I need to disable audioplayer.js in mobile version. In computer version I need audioplayer.js, but in mobile No. How can I disable script? I tried to use this:
$(window).resize(function(){
if($(this).width() < 494) {
$('#script').attr('src', '')
console.log($('#script').attr('src'));
}
else {
$('#script').attr('src', 'js/audioplayer.js');
console.log($('#script').attr('src'));
}
})
but it did not help me. I need to disable script only in mobile version.
Full sample here