url - Editing using Javascript -
i trying put youtube video iframe, when realized have put "embed" between youtube.com , video id. problem extracting these urls api urls in 1 array , direct url video.
is there way me edit url can add embed in between?
you can use string.replace
var url = "http://www.youtube.com/watch?v=xgsy3_czz8k"; var embedurl = url.replace("watch?v=","embed/");
so if wanted replace in array
for (var = 0; < thefeeds.length; i++) { thefeeds[i].link = thefeeds[i].link.replace("watch?v=","embed/"); }
Comments
Post a Comment