Cordova PhoneGap构建将mp3文件下载到sd

Cordova PhoneGap构建将mp3文件下载到sd,cordova,mp3,file-transfer,Cordova,Mp3,File Transfer,我将此代码添加到config.xml中 <feature name="http://api.phonegap.com/1.0/file"/> 我的html中有phonegap.js <script src="phonegap.js"></script> 这是文件传输的代码 <script> function foo() { var fileTransfer = new FileTransfer(); fileTransfer.downl

我将此代码添加到config.xml中

<feature name="http://api.phonegap.com/1.0/file"/>

我的html中有phonegap.js

<script src="phonegap.js"></script>

这是文件传输的代码

<script>
function foo()
{
var fileTransfer = new FileTransfer();
fileTransfer.download(
    "http://mydomain/music.mp3",
    "file://sdcard/Download/music.mp3",
    function(entry) {
        alert("Sound downloaded!");
    },
    function(error) {
        alert("download error source " + error.source);
        alert("download error target " + error.target);
        alert("upload error code" + error.code);
    });
}   
</script>

<span onclick="foo()">Yüklə</span>

函数foo()
{
var fileTransfer=new fileTransfer();
fileTransfer.download(
"http://mydomain/music.mp3",
"file://sdcard/Download/music.mp3",
功能(条目){
警报(“声音下载!”);
},
函数(错误){
警报(“下载错误源”+错误源);
警报(“下载错误目标”+错误目标);
警报(“上传错误代码”+错误代码);
});
}   
尤克尔ə
下载


请帮忙。谢谢我还使用Phonegap 3.0.0版本

您遇到了什么问题?你的问题是什么?当我点击下载时什么都没有发生