I have a url that I want to use in an iframe. The first part of the URL stays the same, the second varies by page. So I want to concatenate them together and use the resulting variable in the src statement. So far I have
<!DOCTYPE html>
<html>
<body>
<script>
var str1="http://bitz.bz/mapplacencia";
var str2="#17/16.51876129/-88.36937785";
var str3=str1+str2;
document.write(str3);
</script>
<p <img style="display: block; margin-left: auto; margin-right: auto;" src="http://hostbelize.com/hotmobile/general/mobile-legend.png" alt="" width="80% alt=" /></p>
<p <iframe width='80%' height='500px' frameBorder='0' src=str3"></iframe></p>
</body>
</html>
The concatenation is working as I can see it from the document.write statement. And I know src=str3 is wrong but I've looked at various examples here and elsewhere on the web and cannot find the right format. I've tried getElementbyId(str3) as I thought that gave the value of the variable but that is not right either.
Can anyone give me the correct format to pass this variable to the src. Thx - Marie