Random Video Generator - Problem

Alright, so I just want an array with embed codes of YouTube videos and each pageload loads a different one from the video. Shouldn’t be too complex yeah?

Here’s the code I’m using, but it won’t work. Can someone help me out please?

<script type="text/javascript">

var video = newArray();
var select=0;

video[0] = "<iframe width="560" height="200" src="http://www.youtube.com/embed/7Am7i7uM9r0" frameborder="0" allowfullscreen></iframe>";

video[1] = "<iframe width="560" height="200" src="http://www.youtube.com/embed/ceBXUyuv4Q0" frameborder="0" allowfullscreen></iframe>";

video[2] = "HTML EMBED CODE HERE"; video[3] = "HTML EMBED CODE HERE";

select = Math.floor(Math.random() * video.length); document.write(video[select]);


Never mind guys, got it figured out. :slight_smile: