seopti
asked on
Insert HTML DIV in Javascript
I need to insert two divs in this javascript code but not sure how.
I would like to insert after the beggining of the script tag:
<div class="infobox-wrapper">
<div id="infobox">
And at the end:
</div></div>
I would like to insert after the beggining of the script tag:
<div class="infobox-wrapper">
<div id="infobox">
And at the end:
</div></div>
<script type="text/javascript">
var poiAddress = " <?php echo $attorneysStuff['bizAddr'];?>, <?php echo $bizCity;?>, <?php echo $bizState;?>";
var poiHTML = ' <?php echo $attorneysStuff['bizName'];?><br><?php echo $attorneysStuff['bizAddr'];?>, <?php echo $attorneysStuff['bizCity'];?><br><?php echo $attorneysStuff['bizState'];?><br>Phone:<?php echo $attorneysStuff['bizPhone'];?>';
var poiZoomLevel = 12;
var infoHTML = "";
</script>
If you actually mean to put them inside the script tags like below, that won't work right. The <div>s won't be recognized and will cause errors in the javascript.
<script type="text/javascript">
<div class="infobox-wrapper">
<div id="infobox">
var poiAddress = " <?php echo $attorneysStuff['bizAddr'];?>, <?php echo $bizCity;?>, <?php echo $bizState;?>";
var poiHTML = ' <?php echo $attorneysStuff['bizName'];?><br><?php echo $attorneysStuff['bizAddr'];?>, <?php echo $attorneysStuff['bizCity'];?><br><?php echo $attorneysStuff['bizState'];?><br>Phone:<?php echo $attorneysStuff['bizPhone'];?>';
var poiZoomLevel = 12;
var infoHTML = "";
</div></div>
</script>
ASKER
Dave, well that's the reason I'm posting here :)
ASKER
Javascript is a dumb programming language, not even simple DIVS are possible. I don't know who invented this shitty language.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
But, today, it's not the right way to do that, it's a bit old school :)) IMHO