I have images in a folder on my server that has all 50 states as the names of each image (nevada.jpg, utah.jpg etc). My tracking software passes State location, and we use the JS code below to show visitors the correct state image based on their location. My problem is, if or any reason we can't pull their location, or they are outside the states, we'd like to have a default image
I've tried just adding a default image in the src but that didn't work.
<a href="http://google.com"><img id="state" src="index_files/deault.jpg" height=300 width=250 class="content-img img-responsive"></a>
<script>
document.getElementById("state").src = "index_files/" + getURLParameter("region") + ".jpg";
</script>
I just need the default image to appear, when no other image is available based on the region parameter