Change to PhoneGap-like JS