Skip to content

Instantly share code, notes, and snippets.

@coryjthompson
Created November 10, 2012 22:00
Show Gist options
  • Select an option

  • Save coryjthompson/4052684 to your computer and use it in GitHub Desktop.

Select an option

Save coryjthompson/4052684 to your computer and use it in GitHub Desktop.

Revisions

  1. Cory Thompson revised this gist Nov 10, 2012. 1 changed file with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions 0.js
    Original file line number Diff line number Diff line change
    @@ -1,9 +1,9 @@
    ft = new FileTransfer();
    var fileTransfer = new FileTransfer();

    ft.onprogress = function(result){
    fileTransfer.onprogress = function(result){
    var percent = result.loaded / result.total * 100;
    percent = Math.round(percent);
    console.log('Downloaded: ' + percent + '%');
    };

    ft.download(remoteFile, localPath, successCallback, errorCallback);
    fileTransfer.download(remoteFile, localPath, successCallback, errorCallback);
  2. Cory Thompson created this gist Nov 10, 2012.
    9 changes: 9 additions & 0 deletions 0.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,9 @@
    ft = new FileTransfer();

    ft.onprogress = function(result){
    var percent = result.loaded / result.total * 100;
    percent = Math.round(percent);
    console.log('Downloaded: ' + percent + '%');
    };

    ft.download(remoteFile, localPath, successCallback, errorCallback);