I am trying to load a random video on page load. This is some javascript that I threw together that I thought might work. I'm not that familiar with javascript, so there might be a much easier way to do this... Any ideas?
function random_video {
var string1 = '<div class="span4"><h3 class="meet">Meet the Makers</h3><iframe width="100%" height="200" src="http://www.youtube.com/embed/Ig-DbfPoz3o" frameborder="0" allowfullscreen></iframe></div>';
var string2 = '<div class="span4"><h3 class="meet">Meet the Makers</h3><iframe width="100%" height="200" src="http://www.youtube.com/embed/estPhyfBGho" frameborder="0" allowfullscreen=""></iframe></div>';
var string3 = '<div class="span4"><h3 class="meet">Meet the Makers</h3><iframe width="100%" height="200" src="http://www.youtube.com/embed/6JL4hpnZklk" frameborder="0" allowfullscreen=""></iframe></div>';
var number = Math.floor((Math.random()*3)+1);
if ( number == 1) {
document.write(string1);
} else ( number == 2 ) {
document.write(string2);
} else ( number == 3 ) {
document.write(string3);
}
};