[TIMOB-10357] iOS: issue loading 'js' files using a javascript loader from a webView
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2013-01-15T11:45:21.000+0000 |
Affected Version/s | Release 2.0.2, Release 2.1.1 |
Fix Version/s | Release 3.1.0, 2013 Sprint 02 API, 2013 Sprint 02 |
Components | iOS |
Labels | SupportTeam, core |
Reporter | Federico Casali |
Assignee | Vishal Duggal |
Created | 2012-07-06T10:39:24.000+0000 |
Updated | 2013-07-17T10:25:36.000+0000 |
Description
Problem description
After using a javascript loader in a Webview to load '.js' files, the result is that all 'js' files are missing on the built version. This does happen only on a real iphone/ipad. Not reproducible using the simulatore. Renaming all 'js' files to '_js' does fix the problemSteps to reproduce
See sample code attached
Run the app. Result: on real devices only the second alert (included in the '_js' file) it's actually triggered. On simulators work fine.Attachments
File | Date | Size |
---|---|---|
MissingJSFilesBugDemo.zip | 2012-07-12T21:27:44.000+0000 | 1573456 |
Thanks for the report. I believe this might be a Titanium Mobile bug.
This ticket does not have sufficient information to diagnose the issue. Please provide complete information along with Java Script files and the project.
If you run the attached project on a simulator, you'll see two alerts. If you run it on an iOS device, the js file alert doesn't show.
Also, if you do a google search for "_js" and Titanium, you will see plenty of references to the same sort of issue. And I should note: It seems that I need to abstract out the "script src" into local variables, before this bug appears.
This is due to minification of all js assets for device builds.
The implementation of a custom protocol for local files has resolved this issue.
Fixed by PR https://github.com/appcelerator/titanium_mobile/pull/3701 against master
js files are being loaded using javascript loader. Verified on: Device : iPhone 4S , iOS version : 5.1.1 SDK: 3.1.2.v20130710144553 CLI version : 3.1.1 OS : MAC OSX 10.7.5 Appcelerator Studio, build: 3.1.2.201307161206 XCode : 4.5.1