Edit in JSFiddle

<div id="mapholder"></div>
<script>
document.addEventListener('DOMContentLoaded', function(){
navigator.geolocation.getCurrentPosition(showPosition);
});
function showPosition(position) {
var latlon = position.coords.latitude + "," + position.coords.longitude;
var img_url = "https://maps.googleapis.com/maps/api/staticmap?center="+latlon+"&markers="+latlon+"&zoom=10&size=400x200&sensor=false";
document.getElementById("mapholder").innerHTML = "<img src='"+img_url+"'>";
}
</script>