ok so im working with execCommand and trying to make a function to insert a youtube video into a content editable div with execcommand inserthtml. Now this works with every other browser except, OMG IE. now i am trying to use pasteHTML(), found that some people have gotten it to work, for its part but for some reason it is not working
please dont tell me to go and use a already created editor. im tired of seeing that lame excuse all over the web.
here is what i got already
insertYouTube: function () { /* This can be improved */
var urlPrompt = prompt("Enter Youtube Url:", "http://");
var urlReplace = urlPrompt.replace("watch?v=", "embed/");
var embed = '<iframe title="YouTube video player" src="'+urlReplace+'" allowfullscreen="true" width="480" frameborder="0" height="390">';
if($.browser.msie){
document.createRange().pasteHTML(embed)
}else{
document.execCommand("Inserthtml", false, embed);
}
}
thanks in advance