Ik heb nu het volgende stukje javascript om youtube videos af te spelen:
	function Show_Vid(type, Yvid, Width, Height) {

		xScroll = document.body.offsetWidth;

		Centering = Math.round(xScroll/2)-Math.round(Width/2);

		if(type == 'youtube') {

			YoutubeVidDiv = document.getElementById('YoutubeVid');

			if(YoutubeVidDiv) { if(YoutubeVidDiv.style.display == 'block') { YoutubeVidDiv.style.display = 'none'; } }

			Body = document.getElementsByTagName('body').item(0);


			var ObjYoutubeVid = document.createElement('div');
			ObjYoutubeVid.setAttribute('id', 'YoutubeVid');
			ObjYoutubeVid.style.position			= 'absolute';
			ObjYoutubeVid.style.display			= 'block';
			ObjYoutubeVid.style.backgroundColor		= '#ffffff';
			ObjYoutubeVid.style.left			= Centering+'px';
			ObjYoutubeVid.style.top				= '20%';
			ObjYoutubeVid.style.width			= Width;
			ObjYoutubeVid.style.height			= Height;
			ObjYoutubeVid.innerHTML				= '<object width="'+Width+'" height="'+Height+'"><param name="movie" value="http://www.youtube.com/v/'+Yvid+'&autoplay=1"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/'+Yvid+'&autoplay=1" type="application/x-shockwave-flash" wmode="transparent" width="'+Width+'" height="'+Height+'"><\/embed><\/object>';

			Body.insertBefore(ObjYoutubeVid, Body.firstChild);

		}

	}


In FF doet dit het wel gewoon en in IE niet... Ziet iemand mischien de fout/bug waardoor die het in IE niet doet? Firebug geeft iig geen fouten aan.

Verder als ik gewoon "bla" inplaats van dit er neer zet:

<object width="'+Width+'" height="'+Height+'"><param name="movie" value="http://www.youtube.com/v/'+Yvid+'&autoplay=1"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/'+Yvid+'&autoplay=1" type="application/x-shockwave-flash" wmode="transparent" width="'+Width+'" height="'+Height+'"><\/embed><\/object>


Zie ik wel gewoon bla staan...

[edit]Splaakgeblek[/edit]
[edit]Het flash object laad ook niet in IE.[/edit]
Jacco schreef op 28.03.2007 15:56
Waarom escape je de slashes wel bij de sluittags en voor de rest niet :)?


Shit zie nu pas ja dat niet alle html tags goed afsluit:S Even kijken of dat het probleem was:p

[edit]Heeft niet geholpen...[/edit]
Ik heb het al weten op te lossen door dit weg te halen:

<object width="'+Width+'" height="'+Height+'"><param name="movie" value="http://www.youtube.com/v/'+Yvid+'&autoplay=1"><\/param><param name="wmode" value="transparent"><\/param>


<\/object>


En dit gewoon te laten staan:

<embed src="http://www.youtube.com/v/'+Yvid+'&autoplay=1" type="application/x-shockwave-flash" wmode="transparent" width="'+Width+'" height="'+Height+'"><\/embed>


Toch bedankt allemaal!:D

Reageren