problem in executing simple example of loki...

3 views
Skip to first unread message

rohit

unread,
May 12, 2009, 5:43:52 AM5/12/09
to Loki API
hi...
i have executing the code using exactly the same code which is pasted
below.........

<html>
<body>
<div id="address">
</div>
<script type="text/javascript" src="http://loki.com/plugin/
files/loki.js">
</script>
<script type="text/javascript">
function init(){
var loki = new LokiAPI();
loki.onSuccess = function(location){
document.getElementById('address').innerHTML =
location.house_number + ' ' + location.street + '<br/>' +
location.city + ', ' + location.region_code + ' ' +
location.postal_code + '<br/>' + location.latitude + ', ' +
location.longitude;
};
loki.onFailure = function(error, msg){
alert('An error has been encountered (' + error +
'). ' + msg);
};
loki.setKey('beta');
loki.requestLocation(true,
loki.FULL_STREET_ADDRESS_LOOKUP);
}

window.onload = init;
</script>
</body>
</html>

<html>
<body>
<div id="address">
</div>
<script type="text/javascript" src="http://loki.com/plugin/
files/loki.js">
</script>
<script type="text/javascript">
function init(){
var loki = new LokiAPI();
loki.onSuccess = function(location){
document.getElementById('address').innerHTML =
location.house_number + ' ' + location.street + '<br/>' +
location.city + ', ' + location.region_code + ' ' +
location.postal_code + '<br/>' + location.latitude + ', ' +
location.longitude;
};
loki.onFailure = function(error, msg){
alert('An error has been encountered (' + error +
'). ' + msg);
};
loki.setKey('beta');
loki.requestLocation(true,
loki.FULL_STREET_ADDRESS_LOOKUP);
}

window.onload = init;
</script>
</body>
</html>

nd after executing it following error message displayed
an error has been encountered(2).Wi-fi is not availaible.

rohit

unread,
May 12, 2009, 5:46:30 AM5/12/09
to Loki API
i'hd also use 'beta' in place of API key. as i don't register for the
key.

Ryan Sarver

unread,
May 12, 2009, 3:47:05 PM5/12/09
to loki...@googlegroups.com
Rohit,

Your code snippet is fine. Do you have a wireless adapter enabled on your
machine? Error 2 means that Loki cannot find a wireless adapter.

Ryan
Reply all
Reply to author
Forward
0 new messages