I'm having issues filling a variable.
I'm using YouTube's API to create a playlist on my website.
I have a list of video codes and I want to loop through and get the video names (eventually more than that), and display them on a page.
For some reason, the videoDesc variable clears out after the for-loop finishes. I'm not getting any errors (at least not in FireFox's error consol), and if I put an alert inside the for-loop, it displays the information. Can you tell what I'm doing wrong?
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js" ></script>
var videoDesc = "Desc: ";
var numVids = myVids.length;
videoDesc += data.data.title + '<br/>';
alert(videoDesc); //shows up blank
$('#result').text(videoDesc); //Does nothing...
Thank you for your help!!!