HTML:
=============================================================
functions.js:
var userID = null;
// onError Callback receives a PositionError object
//
function onError(error) {
var element = $('#geolocation');
element.innerHTML = 'ErrorCode: ' + error.code + '
ErrorMessage:
' + error.message + '
';
}
// onSuccess Geolocation
//
function onSuccess(position) {
var element = $('#geolocation');
element.innerHTML = 'Uploading to BTST:
'+
'Latitude : ' + position.coords.latitude + '
' +
'Longitude: ' + position.coords.longitude + '
' +
'Heading : ' + position.coords.heading + '
' +
'Speed : ' + position.coords.speed + '
' +
'UserID : ' + userID + '
';
var outputE = $('#retVal');
var currentD = new Date();
var myRID = currentD.getMonth() + currentD.getDate();
var upD = newDate(position.timestamp);
var myTime = upD.getHours() + ":" + upD.getMinutes() + ":" +
upD.getSeconds() ;
outputE.innerHTML = myRID + " - " + myTime;
}
// PhoneGap is ready
//
function onDeviceReady() {
userID = device.uuid;
var options = { enableHighAccuracy: true, maximumAge: 500 };
navigator.geolocation.usePhoneGap();
var watchID = navigator.geolocation.watchPosition(onSuccess, onError,
options);
}
// Wait for PhoneGap to load
//
function onLoad() {
document.addEventListener("deviceready", onDeviceReady, false);
}
==============================================
Either I get just the HTML showing with no updates....or a white screen...
Any ideas?
<html>
<head>
<title>Uploader</title>
<link href="jquery.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" charset="utf-8" src="phonegap.js"></
script>
<script type="text/javascript" charset="utf-8" src="jquery.min.js"></
script>
<script type="text/javascript" charset="utf-8" src="functions.js"></
script>
</head>
<body onLoad="onLoad()">
<p id="geolocation"><h4>Finding geolocation...</h4></p>
<br/>
<p><h5>Upload Status:</h5></p>
<p id="retVal"></p>
</body>
</html>
=============================================================
functions.js:
var userID = null;
// onError Callback receives a PositionError object
//
function onError(error) {
var element = $('#geolocation');
element.innerHTML = 'ErrorCode: ' + error.code + '
ErrorMessage:
' + error.message + '
';
}
// onSuccess Geolocation
//
function onSuccess(position) {
var element = $('#geolocation');
element.innerHTML = 'Uploading to BTST:
'+
'Latitude : ' + position.coords.latitude + '
' +
'Longitude: ' + position.coords.longitude + '
' +
'Heading : ' + position.coords.heading + '
' +
'Speed : ' + position.coords.speed + '
' +
'UserID : ' + userID + '
';
var outputE = $('#retVal');
var currentD = new Date();
var myRID = currentD.getMonth() + currentD.getDate();
var upD = newDate(position.timestamp);
var myTime = upD.getHours() + ":" + upD.getMinutes() + ":" +
upD.getSeconds() ;
outputE.innerHTML = myRID + " - " + myTime;
}
// PhoneGap is ready
//
function onDeviceReady() {
userID = device.uuid;
var options = { enableHighAccuracy: true, maximumAge: 500 };
navigator.geolocation.usePhoneGap();
var watchID = navigator.geolocation.watchPosition(onSuccess, onError,
options);
}
// Wait for PhoneGap to load
//
function onLoad() {
document.addEventListener("deviceready", onDeviceReady, false);
}
==============================================
Either I get just the HTML showing with no updates....or a white screen...
Any ideas?


