jQuery GetScript fails with 404 on Phonegap app on Android 4.0

Showing 1-9 of 9 messages
jQuery GetScript fails with 404 on Phonegap app on Android 4.0 Davide Senatore 3/14/12 3:41 AM
Hello, i have a phonegap app, compiled for android. I use jQuery,
jQuery mobile and custom scripts, but the application doesn't work on
Android 4.0.
In mobileinit event i perform a call to jquery getScript to load on
demand a custom script containing some variables. The call returns 404
ONLY on Android 4.0.
On Froyo and Gingerbread everything works perfectly, and the same app,
viewed as a Mobile Site works on every platform, even on Android 4.0.
So, it seems a problem related with assets and PhoneGap and Android
4.0.
Anyone has noticed the same problem?
Thanks!

Davide - gymmit.com

Re: jQuery GetScript fails with 404 on Phonegap app on Android 4.0 Chaaarly 3/22/12 3:08 AM
I have exactly the same problem for my Android/iOS app, no problem with getScript on iOS or previous Android versions. Only a 404 error on Android 4 ICS.

No solution found yet :/
Re: jQuery GetScript fails with 404 on Phonegap app on Android 4.0 Chaaarly 3/22/12 6:09 AM
For information, i tried to update Phonegap to the last version 1.5.0 (Cordova) but nothing changed.

I also tried to put the file on the internet and get it throw a full HTTP URL :


...and it worked.

So i tried with an absolute local URL :

$.getScript("file:///android_asset/www/resources/myscript.js");

...but i had a 404 too. 
 
Hope it will help...

Le mercredi 14 mars 2012 11:41:49 UTC+1, Davide Senatore a écrit :
Re: jQuery GetScript fails with 404 on Phonegap app on Android 4.0 Davide Senatore 3/23/12 6:23 AM
Thanks, i had already done the test, calling a "local" full URL throws
an error 404. I can confirm it.
The problem seems to depend on ICS, due to the fact that the SAME
application works perfectly on Android Gingerbread and Froyo.
This is very bad... and make me feel like i'm creating unstable
applications.
Re: jQuery GetScript fails with 404 on Phonegap app on Android 4.0 Esteban Cuevas 3/26/12 3:17 PM
Same problem here.
Really frustrated about it.

Anyone found any workaround to this?
(Thanks)
Re: jQuery GetScript fails with 404 on Phonegap app on Android 4.0 Kakone 5/15/12 6:39 AM
I have the same problem for local files on Android 4 but also on
Windows Phone. I didn't find any solution.

How have you solved the problem ?

Cordially,
Kakone.
Re: jQuery GetScript fails with 404 on Phonegap app on Android 4.0 Chaaarly 5/15/12 7:53 AM
No, i didn't find any solution.
Re: jQuery GetScript fails with 404 on Phonegap app on Android 4.0 kaore 6/8/12 1:11 AM
Just bumped into the same problem. Yeepeekayay.
Re: jQuery GetScript fails with 404 on Phonegap app on Android 4.0 kaore 6/8/12 2:13 AM
In the end I ended up not using getScript but just a regular javascript function to fetch the js in external files. It worked for me in Android 4.

Try the loadJs function in the answer on this page: http://stackoverflow.com/questions/8631400/load-external-javascript-file