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?

有帮助吗?

解决方案

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.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top