You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by "Jason Ginchereau (JIRA)" <ji...@apache.org> on 2015/11/04 21:06:28 UTC
[jira] [Resolved] (CB-9020) cordova.file undefined on WP8
[ https://issues.apache.org/jira/browse/CB-9020?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Jason Ginchereau resolved CB-9020.
----------------------------------
Resolution: Duplicate
> 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