I have created a web app using HTML, CSS and JS. In previous stages of the app, I have successfully loaded it on to my phone using Phonegap Build, and it "worked" there (still had a ton of bugs).
Now, I have fixed all the bugs and made the app prettier, and it works perfectly on my computer (even in chrome's device simulation with my phone's model in there).
The thing is, when I use Phonegap Build just like I did before, in my phone, the app doesn't respond, and it doesn't work. That made me wonder:
Are there some limitations to what you can do with Phonegap? Or whatever works on the desktop should work too?
To see exactly what's going on, I added a #console
element to the DOM, and logged there in every action. It seems that the $(document).ready()
is working, but that's pretty much it. It doesn't respond to clicks, nor to form submits.
I cannot post the code here because it's way too long.
Asked
Active
Viewed 960 times
1

Gofilord
- 6,239
- 4
- 27
- 43
-
How did you bind your Onclick function? – Tony Chen Aug 10 '14 at 13:29
-
Using jQuery, nothing special: `$('#watched').click(function() ...` – Gofilord Aug 10 '14 at 13:35
-
I don't know how much you know about Phonegap, do you know DeviceReady function in Phonegap? That is the only thing i can think of – Tony Chen Aug 10 '14 at 14:26
-
@TonyChen I replaced jQuery's `$(document).ready()` function with deviceready, and added a script linking to phonegap.js, but nothing has changed. Bummer. – Gofilord Aug 10 '14 at 16:55
-
I don't mean to replaced it. I think you should bind the function after DeviceReady. Or you may send your code to me if it's OK~~ I will try – Tony Chen Aug 10 '14 at 17:10
-
BTW my email: chendatony31 at gmail – Tony Chen Aug 10 '14 at 17:12
-
Have you used "deviceready" event listener – byJeevan Aug 11 '14 at 04:29
-
@Tony I sent the files to your email. – Gofilord Aug 12 '14 at 16:11
1 Answers
3
i have build a android app with your code.
Because I use cordova
so I change your phonegap.js into cordova.js and it works well.

Tony Chen
- 501
- 4
- 16
-
Oh man, it still doesn't work on my Android device. It's frustrating. – Gofilord Aug 13 '14 at 06:17
-
-
@Gofilord Hi, i seem to find out what is wrong... You submit button which is `display:none` is not working on mobile – Tony Chen Aug 14 '14 at 03:37
-
you should read about this :[http://stackoverflow.com/questions/477691/submitting-a-form-by-pressing-enter-without-a-submit-button](http://stackoverflow.com/questions/477691/submitting-a-form-by-pressing-enter-without-a-submit-button) – Tony Chen Aug 14 '14 at 03:40