Telling the difference between a Phonegap build and a local build with the DOM?

StackOverflow https://stackoverflow.com/questions/23643514

  •  22-07-2023
  •  | 
  •  

Pregunta

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?

¿Fue útil?

Solución

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.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top