javascript文件cordova。。如何通过变量传递值

javascript文件cordova。。如何通过变量传递值,javascript,android,jquery,cordova,Javascript,Android,Jquery,Cordova,我正在开发intel cordova应用程序。。。 为了从服务器下载文件,我加入了cordova文件下载插件,但它有我想通过变量传递的数据。。。 这是我的密码: var app = { fileName: "PointerEventsCordovaPlugin.wmv", //<-- pass this value through variable (dynamic) uriString: "http://media.ch9.ms/ch9/8c03/f4fe2512-59e5-4a07-

我正在开发intel cordova应用程序。。。 为了从服务器下载文件,我加入了cordova文件下载插件,但它有我想通过变量传递的数据。。。 这是我的密码:

var app = {

fileName: "PointerEventsCordovaPlugin.wmv", //<-- pass this value through variable (dynamic)
uriString: "http://media.ch9.ms/ch9/8c03/f4fe2512-59e5-4a07-bded-124b06ac8c03/PointerEventsCordovaPlugin.wmv",  // <-- this one also
// Application Constructor
initialize: function() {
    this.bindEvents();
},
var-app={

fileName:“PointerEventsCordovaPlugin.wmv”,//按照您提供的链接中的示例,从应用程序对象中删除fileName和uriString字段,并参数化所需的函数。例如,startDownload将变为:

startDownload: function (fileName, uriString) {

    window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, function(fileSystem) {
        fileSystem.root.getFile(fileName, { create: true }, function (newFile) {
            app.downloadFile(uriString, newFile);
        });
    });
},