simplified js code to test phonegap