function updateResults(result) {
    result.forEach(function (oneresult) {
	// create a result entry
	var newDiv = $('<div/>').addClass('search-result-entry').addClass('container');

	// add the title
	$('<p>').text(oneresult.snippet.title).appendTo(newDiv);

	var rowDiv = $('<div>').addClass('row');
	var imgDiv = $('<div>').addClass('col-sm-4');
	// add the image
	$('<img>').attr({
	    src : oneresult.snippet.thumbnails.default.url,
	    width : oneresult.snippet.thumbnails.default.width,
	    height : oneresult.snippet.thumbnails.default.height
	}).appendTo(imgDiv);
	
	// add the link
	$('<a>').attr({
	    href : "https://www.youtube.com/watch?v=" + oneresult.id.videoId,
	    target : '_blank'
	}).text('watch').appendTo(imgDiv);
	imgDiv.appendTo(rowDiv);
	
	var detailsDiv = $('<div>').addClass('col-sm-8');
	$('<label>').text('Artist').appendTo(detailsDiv);
	var inputArtist = $('<input>').attr({
	    id : 'video_' + oneresult.id.videoId + '_artist'
	}).appendTo(detailsDiv);
	$('<label>').text('Instrument').appendTo(detailsDiv);
	var inputInstrument = $('<input>').attr({
	    id : 'video_' + oneresult.id.videoId + '_instrument'
	}).appendTo(detailsDiv);
	$('<label>').text('Raga').appendTo(detailsDiv);
	var inputRaga = $('<input>').attr({
	    id : 'video_' + oneresult.id.videoId + '_raga'
	}).appendTo(detailsDiv);
	$('<button>').text('save').click({
	    id : oneresult.id.videoId,
	    title : oneresult.snippet.title,
	    input_artist : inputArtist,
	    input_instrument : inputInstrument,
	    input_raga : inputRaga
	}
					 ,updateVideoData).appendTo(detailsDiv);
	detailsDiv.appendTo(rowDiv);
	rowDiv.appendTo(newDiv);
	
	// add the result entry
	newDiv.appendTo('#search-results');
    });
}
/**
 * Convert the list of responses obtained from a youtube
 * video search into div's with data entry boxes
 *
 * @param result array of objects, each having id and snippet objects
 * @return void
 */
Convert the list of responses obtained from a youtube
video search into div's with data entry boxes

@param result array of objects, each having id and snippet objects
@return void
Convert the list of responses obtained from a youtube video search into div ' s with data entry boxes @param result array of objects each having id and snippet objects @return void
function updateResults(result) {
    result.forEach(function (oneresult) {
	var newDiv = $('<div/>').addClass('search-result-entry').addClass('container');
	$('<p>').text(oneresult.snippet.title).appendTo(newDiv);
	var rowDiv = $('<div>').addClass('row');
	var imgDiv = $('<div>').addClass('col-sm-4');
	$('<img>').attr({
	    src : oneresult.snippet.thumbnails.default.url,
	    width : oneresult.snippet.thumbnails.default.width,
	    height : oneresult.snippet.thumbnails.default.height
	}).appendTo(imgDiv);
	$('<a>').attr({
	    href : "https://www.youtube.com/watch?v=" + oneresult.id.videoId,
	    target : '_blank'
	}).text('watch').appendTo(imgDiv);
	imgDiv.appendTo(rowDiv);
	var detailsDiv = $('<div>').addClass('col-sm-8');
	$('<label>').text('Artist').appendTo(detailsDiv);
	var inputArtist = $('<input>').attr({
	    id : 'video_' + oneresult.id.videoId + '_artist'
	}).appendTo(detailsDiv);
	$('<label>').text('Instrument').appendTo(detailsDiv);
	var inputInstrument = $('<input>').attr({
	    id : 'video_' + oneresult.id.videoId + '_instrument'
	}).appendTo(detailsDiv);
	$('<label>').text('Raga').appendTo(detailsDiv);
	var inputRaga = $('<input>').attr({
	    id : 'video_' + oneresult.id.videoId + '_raga'
	}).appendTo(detailsDiv);
	$('<button>').text('save').click({
	    id : oneresult.id.videoId,
	    title : oneresult.snippet.title,
	    input_artist : inputArtist,
	    input_instrument : inputInstrument,
	    input_raga : inputRaga
	}
					 ,updateVideoData).appendTo(detailsDiv);
	detailsDiv.appendTo(rowDiv);
	rowDiv.appendTo(newDiv);
	newDiv.appendTo('#search-results');
    });
}
function updateResults ( result ) { result . forEach ( function ( oneresult ) { var newDiv = $ ( '<div/>' ) . addClass ( 'search-result-entry' ) . addClass ( 'container' ) ; $ ( '<p>' ) . text ( oneresult . snippet . title ) . appendTo ( newDiv ) ; var rowDiv = $ ( '<div>' ) . addClass ( 'row' ) ; var imgDiv = $ ( '<div>' ) . addClass ( 'col-sm-4' ) ; $ ( '<img>' ) . attr ( { src : oneresult . snippet . thumbnails . default . url , width : oneresult . snippet . thumbnails . default . width , height : oneresult . snippet . thumbnails . default . height } ) . appendTo ( imgDiv ) ; $ ( '<a>' ) . attr ( { href : "https://www.youtube.com/watch?v=" + oneresult . id . videoId , target : '_blank' } ) . text ( 'watch' ) . appendTo ( imgDiv ) ; imgDiv . appendTo ( rowDiv ) ; var detailsDiv = $ ( '<div>' ) . addClass ( 'col-sm-8' ) ; $ ( '<label>' ) . text ( 'Artist' ) . appendTo ( detailsDiv ) ; var inputArtist = $ ( '<input>' ) . attr ( { id : 'video_' + oneresult . id . videoId + '_artist' } ) . appendTo ( detailsDiv ) ; $ ( '<label>' ) . text ( 'Instrument' ) . appendTo ( detailsDiv ) ; var inputInstrument = $ ( '<input>' ) . attr ( { id : 'video_' + oneresult . id . videoId + '_instrument' } ) . appendTo ( detailsDiv ) ; $ ( '<label>' ) . text ( 'Raga' ) . appendTo ( detailsDiv ) ; var inputRaga = $ ( '<input>' ) . attr ( { id : 'video_' + oneresult . id . videoId + '_raga' } ) . appendTo ( detailsDiv ) ; $ ( '<button>' ) . text ( 'save' ) . click ( { id : oneresult . id . videoId , title : oneresult . snippet . title , input_artist : inputArtist , input_instrument : inputInstrument , input_raga : inputRaga } , updateVideoData ) . appendTo ( detailsDiv ) ; detailsDiv . appendTo ( rowDiv ) ; rowDiv . appendTo ( newDiv ) ; newDiv . appendTo ( '#search-results' ) ; } ) ; }
Convert the list of responses obtained from a youtube
 video search into div's with data entry boxes
Convert the list of responses obtained from a youtube video search into div ' s with data entry boxes
// create a result entry // add the title // add the image // add the link // add the result entry