I\'m developing a web application that uses PhoneGap:Build for a mobile version and want to have a single codebase for the \'desktop\' and mobile versions. I want to be able
I was trying with the window objects but it didn't worked as I was opening the remote url in the InAppBrowser. Couldn't get it done. So the best and easiest way to achieve it was to append a string to the url which you need to open from the phonegap app. Then check if the document location has string appended to it.
Below is the simple code for it
var ref = window.open('http://yourdomain.org#phonegap', '_blank', 'location=yes');
You will see a string is added to the url "#phonegap".So in the domain url add the following script
if(window.location.indexOf("#phonegap") > -1){
alert("Url Loaded in the phonegap App");
}