Inside the app, I used a very useful library called "LoadTemplate" (I couldn't find out the Github URL again) to load template files to my application (through Handlebars), and that worked for months on any browser and Android systems, but now it's necessary to put it on iOS, a simple job, and in fact, it was. The application ran from the first time using Xcode, but something went wrong: the template files didn't load.
No matter what iOS version I played it on the emulator, or what kind of permissions the folders are set at, it didn't work.
So, I traced the part of the library that made the load through the XMLHttpRequest object, and I found out a weird behavior.
The lines in particular are:
req.onreadystatechange = function(){
if (req.readyState == 4 && req.status == 200){
In a simple verification in iOS, the property status is always set to 0, at least for me, so, I remove that property and everything returned to the normally.
Finally, the code stayed like this
req.onreadystatechange = function(){
if (req.readyState == 4){
No comments:
Post a Comment