Response title
This is preview!
$('#btnLocationUpdate').live('click', function (e) {
alert('updating location'); // this works perfect
if (Modernizr.geolocation) { // from here, it navigates
navigator.geolocation.getCurrentPosition(show_map);
}
else {
alert('Location not supported');
}
});
function show_map(position) {
var lat = position.coords.latitude;
var lon = position.coords.longitude;
var locationUpdateUrl = 'locate updated to server';
alert(locationUpdateUrl);
$.ajax({ type: 'GET', contentType: 'application/json', dataType: 'json', url: locationUpdateUrl, success: onUpdateSuccess });
}
function onUpdateSuccess(result) {
if (result.code == 200) {
alert('Located now');
}
}
event.preventDefault();
event.stopPropagation();
<ul data-role="listview" data-theme="e" data-position="fixed" id="content_list"></ul>Snippe
for ($i = 0; $i < (result.data.item.length); $i++) {
var text2 = '<li>';
if (result.data.item[$i].count > 0) {
text2 = text2 + '<img alt="punten" src="icons/brightness32.png"/> ';
}
else {
text2 = text2 + '<img alt="punten" src="icons/brightness16.png"/> ';
}
text2 = text2 + result.data.item[$i].title + '</a></br> ' + result.data.item[$i].count + ' Punten</li>';
$('div').find('#content_list').append(text2);
}
What's wrong in this?
var text = '<li style="padding:10px" class="ui-btn-up-e"><a style="text-decoration: none; color: #000000;" href="' +
result.data.item[$i].url + '">' + result.data.item[$i].title + '</a><span class="ui-li-count">' +
result.data.item[$i].reward + '</span></li>';
marker = new google.maps.Marker({
position: new google.maps.LatLng(latitude, longitude),
map: map,
icon: 'http://www.sunloverholidays.com.au/libimages/googleMapMarkerSmall.png'
});
markersArray.push(marker);
google.maps.event.addListener(marker, 'click', function () {
var contentString = items.text;
var infowindow = new google.maps.InfoWindow({
content: contentString
});
infowindow.open(map, marker);
});
© 2013 jQuery Foundation
Sponsored by and others.