0

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

2
Contributors
3
Replies
4
Views
6 Years
Discussion Span
Last Post by foo123
0

you know whats crazy. is that no one in the javascript forms seems to want to help anyone else.

im not talking about this one post. but i have posted multiple times with out a single reply to any.

WTF

0

i've seen somewhere that in order to make insert html work in ie you have to make another
div (a new div) and insert html in ther (using innerHTML for example) nad then insert the div element in the content you have..

also try out this link

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.