Many are asking me about this matter of how to properly validate a number using Regular Expression, so I decided to write this post to share with you from my experience and research. And most important thing that really bothers me, is that the internet is full of examples and solutions for exactly this task, but unfortunately most of them are incorrect or incomplete.

Read more

I spent hours to find out how to do it. And believe me or not, I found nothing on the whole internet about how to solve it. Actually there is a simple way to do that after the event “deviceready” has been triggered (as described on the PhoneGap’s API Docs), it is simple as: The “deviceready” trigger, tell us when all native components are loaded and ready to use. Which means, that there is no way to determine whether the page loaded from PhoneGap or not using the PhoneGap plugin itself. You can check the UserAgent, but it is not always true, because it is possible to open the page through the mobile’s browser which is the same UserAgent as loaded from PhoneGap. Let’s give a typical example, that describes the case better. Let’s say I want to perform an action when the device is ready and the document is…

Read more

2/2