Possible Duplicate:
JavaScript: How do I print multiple script tags in a loop?
Im trying to print these elements from an array but i get a blank screen
<div id="playerContainer" style="width: 20em; height: 180px; float: left;">
<object id="player"></object>
</div>
<div id="videos2"></div><script type = "text/javascript">
for (var i=0; i<arr.length; i++) {
document.write("<script
type="text/javascript"
src="http://gdata.youtube.com/feeds/api/videos?q=arr["+i+"] &max-results=8&orderby=relevance&alt=json-in-script&format=5&callback=showMyVideos2">
</script>");
}
</script>
My version – assuming arr contains stuff you want to send to the q=