sunshine1907
Posts: 0
Joined: Thu Apr 11, 2013 2:16 pm

Loading java-script from source / then no mobile preview possible

Following problem.

My APP is written in 99% on HTML, also with JAVA. In my "< head " I'm loading a JAVA source, like:
"< head
< script type="text/javascript" src="files/views/assets/js/example.js" < /script
< /head
......"

If I install my APP directly on mobile, it works without problems, but the mobile preview isn't possible anymore. If I click on the button to load my page, it hangs.
On mobile (installed) directly, it works.

Do you have any ideas ?

sunshine1907
Posts: 0
Joined: Thu Apr 11, 2013 2:16 pm

Loading java-script from source / then no mobile preview possible

is it also possible to load more than 1 script for one HTML page ?.
For example:

"< head
< script type="text/javascript" src="files/views/assets/js/example.js" < /script
< script type="text/javascript" src="files/views/assets/js/example2.js" < /script
< script type="text/javascript" src="files/views/assets/js/example3.js" < /script
< /head

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

Loading java-script from source / then no mobile preview possible

You can load any number of JavaScript files, go to Project App Settings External resources.

sunshine1907
Posts: 0
Joined: Thu Apr 11, 2013 2:16 pm

Loading java-script from source / then no mobile preview possible

Hi Max,

thanks for answer. OK, this I know and it's of course very nice. But my files I want load as java files, have a special connection to each html-file. In this case mostly special variables. This I cannot load in general, or ?.
But much more is my main problem, why the mobile preview isn't working anymore, after I pasted the script-code to load the js-file. Very funny is the fact, if I change for example the source code from:
< script type="text/javascript" src="files/views/assets/js/example.js" < /script
to
< script type="text/javascript" xsrc="files/views/assets/js/example.js" < /script

then the page on mobile preview loads but then the script don't work anymore.
My question is in this case... where could be the fault, that the preview isn't possible anymore, if I want load a script of java like < script type="text/javascript" src="files/views/assets/js/example.js" < /script

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

Loading java-script from source / then no mobile preview possible

You can't load Java files as the app is running in the browser. You can only load JavaScript files. As for why the preview is not working, check in the browser console to see if there are any errors.

Return to “Issues”