我有一小段JQuery,它创建一个只包含一个字符串的.M3U文件,然后提示用户下载。这在Chrome中工作正常但在Firefox中没有效果,并且FireFox控制台上不会出现任何错误。有人可以帮忙吗?
function playfile(filepath) {
var file = document.createElement('a');
file.setAttribute('href', 'data:text/plain;charset=utf-8,' + decodeURIComponent(unescape(filepath)));
file.setAttribute('download', "Play.m3u");
file.click();
}