Question

I have a Phonegap app that I am developing and I would love to be able to tell the difference between one built on their server and one built locally on my machine.

Is there anything in the DOM that might give this information away?

Was it helpful?

Solution

Found a solution, whilst its not with the DOM its the only way I can see of checking which version I am in...

    $.ajax({
        url:'file:///android_asset/www/icon-72-2x.png',
        type:'HEAD',
        error: function()
        {
            //file does not exists
        },
        success: function()
        {
            //file exists
        }
    });

Only works with Android, but paths can be changed to match iPhone and the other devices as well.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top