Padonak;1270517 wrote:try window.onload = getLocation; instead of window.onload = getLocation();
That worked, but the problem stays. It still fails to display the data. I don't know what it is, but I get a bug when I try running it through an eclipse editor.
06-01 17:00:41.078: E/Web Console(8061): Uncaught TypeError: Cannot set property 'innerHTML' of null at file:///android_asset/www/GPSTraker.html:35
The other strange thing is this.
if (navigator.geolocation)
{
alert("Fired");
navigator.geolocation.getCurrentPosition(showPosition);
}
The alert is not fired for some reason. The function is called (I tested that), but for some reason the if statement is never fired. That leads me to belive that this problem is linked an innerHTML issue and a Navigator one.
EDIT: Defiantly a problem with the innerHTML. Tested the else that fired. This means there is a nav problem as well.
EDIT2: Solved both. Had to get element within function, and Chrome was responsible for the lack of data. 