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

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

  •  22-07-2023
  •  | 
  •  

سؤال

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