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

Popular posts from this blog

Delphi XE2 Indy10 udp client-server interchange using SendBuffer-ReceiveBuffer -

Qt ActiveX WMI QAxBase::dynamicCallHelper: ItemIndex(int): No such property in -

Enable autocomplete or intellisense in Atom editor for PHP -