I am coding an e-commerce website using XHTML in visual studio. At the moment to build the contact page I'm using Google API's to be able to show the store's location in an interactive map. My question is:
- In case the user has the JS disabled in the browser how would I show a static image of the location without using the nonscript tag ah it is non XHTML compliant?
So far I have this within a few other elements in the body tag, only showing this to make the question easier to understand:
<noscript><img src="map.png" class="map_location" /></noscript>
<div id=map></div>
which interacts with a Javascript file
function initMap() {
var wannabemarker = { lat: 53.273301, lng: -2.817487 };
var map = new google.maps.Map(document.getElementById('map'), {
center: wannabemarker,
zoom: 12
});
var marker = new google.maps.Marker({
position: wannabemarker,
map: map
});
}
The map works perfectly both with JS on and the static image shows if JS off but comes up with validation error and I have to make it disappear. Any help would be kindly appreciated.
Thank you