I have been doing my first PhoneGap App today and as part of the exercise, I am using jQuery Mobile 1.0, PhoneGap 1.2 on Xcode 4.2 on my MacBook Pro. The first thing I did was to copy/paste some code from jQuery Mobile site into my HTML page. I won’t be pasting the entire code here but I was trying to include jQuery Mobile JS/CSS files in the page.
And then I had some other HTML as well. However, when I tried to run the Build, in the Debug Area in XCode, I saw the following error come up :-
SampleApp[549:17803] ERROR whitelist rejection: url='http://code.jquery.com/jquery-1.6.4.min.js'
“Whitelist Rejection” – Immediately I knew it was something to do with URLs not being accessible.
A quick Google Search confirmed that and the solution is easy. In your PhoneGap.plist file, you need to add the allowed URLs to the ExternalHosts array. I added “*” as I did not want to add each individual URL separately to the list but that’s your choice.