cordova-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jason Ginchereau (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CB-9020) cordova.file undefined on WP8
Date Thu, 05 Nov 2015 01:20:27 GMT

    [ https://issues.apache.org/jira/browse/CB-9020?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14990886#comment-14990886
] 

Jason Ginchereau commented on CB-9020:
--------------------------------------

This is maybe not a duplicate of CB-8257, if that one is referring to WP 8.0 and this one
is WP 8.1.

> cordova.file undefined on WP8
> -----------------------------
>
>                 Key: CB-9020
>                 URL: https://issues.apache.org/jira/browse/CB-9020
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: Plugin File
>    Affects Versions: 2.0.0
>         Environment: Windows Phone 8 emulator
>            Reporter: Rex Park
>            Priority: Critical
>
> I have some code that tries to list all of the files in www/json. It works correctly
on iOS and Android but fails on Windows Phone 8.1.
> The code is pretty straight forward:
> window.resolveLocalFileSystemURL(cordova.file.applicationDirectory+'/www/json', 
>         function(dirEntry){
>             var directoryReader = dirEntry.createReader();
>             directoryReader.readEntries(
>                 function(entries){
>                     ups_json_file_count = entries.length;
>                     var i;
>                     for (i=0; i < ups_json_file_count; i++) {
>                         $.getJSON("json/"+entries[i].name, parse_json_files);
>                     }
>                 },
>                 function(){
>                     console.log("Coudl Not Locate JSON Files. 2");
>                 }
>             );
>         }, 
>         function(error){
>             console.log("Could Not Locate JSON Directory. 1");
>         }
>     );
> After doing some digging I found that cordova.file is coming up as undefined. The above
code is being called inside of the onDeviceReady function.
> cordova-plugin-file 2.0.0 "File"
> cordova-plugin-file-transfer 1.0.0 "File Transfer"



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


Mime
View raw message