What is the state of whitelisting in phonegap 1.3.0?

The whitelist is present on both iOS and Android, but not other platforms yet. Under iOS, it goes under the name of “External Hosts,” which is explained here: http://wiki.phonegap.com/w/page/41631150/PhoneGap%20for%20iOS%20FAQ Q. Links to and imported files from external hosts don’t load? A. The latest code has the new white-list feature. If you are referencing external hosts, … Read more

blank white screen after FB login via web app?

All you need to do is adding ” display:’touch’ ” and redirect_uri parameters to the login as : FB.login(function(response) { if (response.authResponse) { console.log(‘Welcome! Fetching your information…. ‘); FB.api(‘/me’, function(response) { console.log(‘Good to see you, ‘ + response.name + ‘.’); FB.logout(function(response) { console.log(‘Logged out.’); }); }); } else { console.log(‘User cancelled login or did not … Read more

Mobile Safari $(window).height() URL bar discrepancy

Tldr If you just want to query the window height, cross-browser, and be done with it, use jQuery.documentSize and call $.windowHeight(). For implementing your own solution, read on. When to use jQuery or the clientHeight of the document jQuery’s $(window).height() is a wrapper for document.documentElement.clientHeight. It gives you the height of the viewport, excluding the … Read more

CSS background-position not working in Mobile Safari (iPhone/iPad)

The iPhone/Webkit browser cannot center align background images when placed in the body tag. The only way around this is to remove the background image from your body tag and use an additional DIV as a wrapper. #wrapper { background-color: #000000; background-image: url(‘images/background_top.png’); background-repeat: no-repeat; background-position: center top; overflow: auto; } <html lang=”en”> <head> <title>Title</title> … Read more

Use PhoneGap to Check if GPS is enabled

You could check the error code in PositionError parameter of geolocationError in your call to getCurrentPosition. I am guessing that it will be PositionError.PERMISSION_DENIED when gps is not enabled, and PositionError.POSITION_UNAVAILABLE or PositionError.TIMEOUT when gps is enabled but there are other issues. Note that this is platform dependent. You would probably have to write a … Read more

Multiple select in Safari iOS 7

// hack for iPhone 7.0.3 multiselects bug if(navigator.userAgent.match(/iPhone/i)) { $(‘select[multiple]’).each(function(){ var select = $(this).on({ “focusout”: function(){ var values = select.val() || []; setTimeout(function(){ select.val(values.length ? values : [”]).change(); }, 1000); } }); var firstOption = ‘<option value=”” disabled=”disabled”‘; firstOption += (select.val() || []).length > 0 ? ” : ‘ selected=”selected”‘; firstOption += ‘>&laquo; Select ‘ … Read more