前提是,不能跨域访问
引入jquery库
<script src="jQuery.js" type="text/javascript"></script>
在$(function(){});中加入以下代码:
    $.ajax({
        url : playlist[0].mp3,
        type : 'HEAD',
        error : function() {
            alert("播放失败,对应音乐文件不存在");
        },
        success : function() {
        }
    });

 注意把type设置为HEAD,获取文件头而忽略文件内容

相关文章:

  • 2021-09-25
  • 2022-12-23
  • 2022-12-23
  • 2022-02-03
  • 2021-06-03
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-02-23
  • 2021-06-16
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案