How do I convert from url to embed code for vimeo youtube etc. using Javascript -
i have code
var videoreg = new regexp(/^(<iframe.*? src=")(.*?)(\??)(.*?)(".*)$/mg); if( document.getelementbyid('area1').value.match(videoreg)) { var c1 = document.getelementbyid('area1').value; var divelement = document.createelement("div"); divelement.id = "mydiv"; divelement.classname = "mydivclass"; divelement.innerhtml = c1; document.body.appendchild(divelement); form1.reset(); var button = document.getelementbyid("remove"); button.addeventlistener("click", function() { divelement.parentnode.removechild(divelement); }); } else{ alert("please insert correct embed code!"); } }
i want change paste in url , changes embed code iframe appears on screen.
Comments
Post a Comment