This does happen only on a real iphone/ipad. Not reproducible using the simulatore.
Renaming all 'js' files to '_js' does fix the problem
Run the app.
Result: on real devices only the second alert (included in the '_js' file) it's actually triggered.
On simulators work fine.