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

Raven Zuo commented on CB-10946:
--------------------------------

link to cordova-app-loader: 
https://github.com/markmarijnissen/cordova-app-loader

> dynamically load JS/CSS file into index.html doesn't work with cordova 6.0.0
> ----------------------------------------------------------------------------
>
>                 Key: CB-10946
>                 URL: https://issues.apache.org/jira/browse/CB-10946
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: iOS
>    Affects Versions: 6.0.0
>         Environment: Ionic 1.7.14, Cordova 6.0.0, iOS devices
>            Reporter: Raven Zuo
>            Priority: Critical
>
> I use a plugin called cordova-app-loader to update our app from resource 
> server so that if we only change JS/html/css files, we don't need submit to 
> apple for review. It works perfectly before with old Cordova which generate 
> iOS3.9.2 build. After upgrading Cordova to 6.0.0, the generated iOS version 
> is now 4.0.1 and it doesn't work anymore. 
> I checked into the issue and found that even I remove the updating from 
> resource server part, only load the js files to index.html dynamically, the 
> app will freeze after load all the js files.
> Details of my current process: 
> 1. In my index.html file's head, there is some lib js files like cordova.js 
> etc. Among them, the last js file is my bootstrap.js
> 2. the bootstrap.js file will read a manifest.json file(which include file 
> paths need to be add to index.html dynamically) and get all the js files need 
> be loaded.
> 3. Add all these files into index.html with the following code:
>       var el,
>       head = document.getElementsByTagName('head')[0],
>       src = the_path_to_the_js_file,
>       now = Date.now();
>       el= document.createElement('script');
>       el.type= 'text/javascript';
>       el.src= src + '?' + now;
>       el.async = false;
>       head.appendChild(el);
> 4. I added a log message into the last js file which will be dynamically 
> loaded and in the console window, I saw this message which means the js files 
> are all loaded.
> But then after that, the app just freezes forever.



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

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to