I am unable to set json value to scr attribute of embed tag from javascript file.
$.getJSON(“url”,function(data){
jsonMovies = data.Movies;
$.each(data.Movies, function(index,value){
numofMovs[i]= index;
if (numofMovs[i] == 'Movie6')
{
var parent = $('embed#video1').parent();
$('embed#video1').remove();
parent.append('<embed type="video/mp4" width="200px" height="200px" id = "video1"
src=value.Video />');
}
}
}
Please let me know the correct syntax for including the json value in src attribute (src=value.Video).
Thanks,
Surabhi
You need to concatenate the value into the string:
There’s a considerable difference between: