Typo.js icon indicating copy to clipboard operation
Typo.js copied to clipboard

Asynchronous file load using the file protocol (file://)

Open gevyaniv opened this issue 8 years ago • 1 comments

Thank you for taking the time to develop this library.

A small issue I found: In the _readFile method, the code is checking for status 200 (line 238) in order to resolve the promise. Some environments, like Cordova iOS, return status 0 as success. See the following post. Adding (req.status === 200 || req.status === 0) can solve the problem.

It would also be great if you can if you can return the Promise all the way to the initial load of the library. I think is the Typo constructor that calls the readDataFile. This will give the user the option to handle Promise rejections, which are not currently handled by the library.

gevyaniv avatar Jul 19 '16 14:07 gevyaniv

see promise implementation here https://github.com/cfinke/Typo.js/pull/50

kofifus avatar Sep 04 '16 09:09 kofifus