Skip to main content

Answered Question I can't read silverlight tag in IE !!RSS Feed

(0)

zenaxm
zenaxm

Member

Member

0 points

7 Posts

I can't read silverlight tag in IE !!

Here's a simple markup.

<div id="div1">
    <object data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="640px" height="480px">
    </object>
</div>

and executing alert(document.getElementById("div1").innerHTML); shows me

<OBJECT type=application/x-silverlight-2 height=480 width=640 data=data:application/x-oleobject;base64,QfXq3+HzJEysrJnDBxUISgAIAAAlQgAAnDEAAAAAAAAAAAAAAAAAAAAAAAA8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA></OBJECT>

And that means I can't upload silverlight contents via wysiwyg editor!! You can try to upload any silverlight contents in any forums that support wysiwyg editor. The result would be broken markup.

This is really a serious problem. I can't believe it is not issued much until now.
(Someone else also described the issue here. http://silverlight.net/forums/t/21032.aspx)
(I'm writing a yui editor's plug-in that enables silverlight content uploading and embedding.)

 

 

 

ken tucker
ken tucker

All-Star

All-Star

18166 points

2,749 Posts

Re: I can't read silverlight tag in IE !!

wysiwyg editors do that to a lot of different types on content.  Not just silverlight.  I do not think this is an silverlight issue it is a problem with the editors. 

zenaxm
zenaxm

Member

Member

0 points

7 Posts

Re: I can't read silverlight tag in IE !!

I can upload silverlight contents in firefox and chrome. I can't upload silverlight contents only in IE. So this is not the editor problem.

 

zenaxm
zenaxm

Member

Member

0 points

7 Posts

Re: I can't read silverlight tag in IE !!

One more example.

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
    <title></title>
    <script type="text/javascript" language="javascript">

    	function duplicateIt() {
    		document.getElementById("div2").innerHTML = document.getElementById("div1").innerHTML;
    	}

    </script>
</head>
<body onload="duplicateIt();">
	<div id="div1">
		<object data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="400px" height="400px">
			<param name="source" value="http://www.silverlightshow.net/storage/userfiles/GlowEffect_RTW.xap">
			<param name="background" value="white">
			<param name="minRuntimeVersion" value="2.0.31005.0">

			<a href="http://go.microsoft.com/fwlink/?LinkID=124807" style="text-decoration: none;">
				<img src="http://go.microsoft.com/fwlink/?LinkId=108181" style="border-style: none;">
			</a>
		</object>
	</div>
	<div id="div2">
	</div>
</body>
</html>
  

Try save and open this html using firefox, chrome and IE. Only IE doesn't duplicate the content.

 

chenaoxiang
chenaoxiang

Member

Member

2 points

1 Posts

Re: I can't read silverlight tag in IE !!

Really?? It is too bad!

 

 

Jonathan Shen – MSFT
Jonathan...

All-Star

All-Star

29213 points

2,831 Posts

Microsoft

Re: I can't read silverlight tag in IE !!

Hi Zenax,

Why do you want to copy the content like this way?  This way works on Chrome but not with Firefox 3.5 and IE8. As a workaround, we need to go through the div's innerHTML.  If there is a object tag, we use javascript to create it manually.  However, it is a kind of pain.  Another way is put all the controls inside the Silverlight application and copy the content on its code behind.

Best regards,

Jonathan

Jonathan Shen
Microsoft Online Community Support
Please remember to mark the replies as answers if they help and unmark them if they provide no help.

zenaxm
zenaxm

Member

Member

0 points

7 Posts

Re: I can't read silverlight tag in IE !!

I'm extending yui wysiwyg editor(http://developer.yahoo.com/yui/editor/) to allow site users to upload video.

1. user uploads a video file using ajax.
2. when the upload completes, setup silverlight video player tag with proper parameters and insert it into the editor
3. call the editor's saveHTML() method on submit to copy the editor's content(which is in the iframe) to the textarea.

and at this point the markup is screwed up.

I've tested with FireFox 3.5.2 and and there was no problems. Only IE doesn't correctly copies the tag.

Jonathan Shen – MSFT
Jonathan...

All-Star

All-Star

29213 points

2,831 Posts

Microsoft
Answered Question

Re: I can't read silverlight tag in IE !!

Hi Zenaxm,

You'd better create a MediaElement and make it invisible.  When we uploaded the video, we will get a url that indicates where the video is restored by  WCF.

Now after we get the url, we can show the player and set its video source.   To set its source, we can do it on code behind or Javascript.  Another way is to use a Silverlight enabled Rich Editor and do all the things on code behind.

Best regards,

Jonathan 

Jonathan Shen
Microsoft Online Community Support
Please remember to mark the replies as answers if they help and unmark them if they provide no help.

zenaxm
zenaxm

Member

Member

0 points

7 Posts

Re: I can't read silverlight tag in IE !!

We need to let our users to freely position the video in the post using rich text editor just like they upload and position the image.

There should be a way to correctly read silverlight tags, otherwise silverlight SUCKS. Contents that can't be dynamically manipulated? Is it a technology that developed before the DHTML? That doesn't make sense at all.

Can someone at microsoft at least tell me is it silverlight bug or ie bug?

Jonathan Shen – MSFT
Jonathan...

All-Star

All-Star

29213 points

2,831 Posts

Microsoft
Answered Question

Re: I can't read silverlight tag in IE !!

Hi Zenaxm,

Actually, I think that are different behaviors between different browsers indeed.  I tried to find something details but failed.

Best regards,

Jonathan

Jonathan Shen
Microsoft Online Community Support
Please remember to mark the replies as answers if they help and unmark them if they provide no help.

zenaxm
zenaxm

Member

Member

0 points

7 Posts

Re: I can't read silverlight tag in IE !!

Here's the blog posts that is posted using three different browsers.

http://zenaxm.blogspot.com/2009/08/posted-using-google-chrome.html (Google Chrome)

http://zenaxm.blogspot.com/2009/08/posted-using-firefox-3011.html (FireFox)

http://zenaxm.blogspot.com/2009/08/posted-using-ie7.html (IE)

The posts has a silverlight content and are written exactly the same way (I switched to 'edit html' mode and pasted the following markup and then switched back to normal rich text editing mode and saved it).

<object style="height: 250px; width: 200px;" type="application/x-silverlight" data="data:application/x-silverlight,"><param value="http://slkit.blob.core.windows.net/xaps/ToolkitBanner.xap" name="source"/><param value="true" name="windowless"/></object>

You can see that only IE didn't correctly save the post. The only way to include silverlight contents using IE is that write and save all the post contents using 'edit html' mode. In other words I should use plane textarea instead of rich text editor.

I cannot include anything that's silverlight in my blog post using IE. And you call it different browser behavior?

ken tucker
ken tucker

All-Star

All-Star

18166 points

2,749 Posts

Re: Re: I can't read silverlight tag in IE !!

The web html editor is suspose to break javascript and object tags for security reasons. 

zenaxm
zenaxm

Member

Member

0 points

7 Posts

Re: Re: I can't read silverlight tag in IE !!

It's broken simply because IE cannot copy the silverlight object tags correctly and it has nothing to do with security. All other browsers didn't cause problems.

Jonathan Shen – MSFT
Jonathan...

All-Star

All-Star

29213 points

2,831 Posts

Microsoft

Re: Re: I can't read silverlight tag in IE !!

Hi Zenaxm,

After I add style to the second div(set its width and height property),  it works on Firefox 3.5.   Then, I used Web Development helper to get the generated html and found that

<object data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="100%" height="100%">
    <param name="source" value="ClientBin/CopyXaml.xap"/>
    <param name="onError" value="onSilverlightError" />
    <param name="background" value="white" />
    <param name="minRuntimeVersion" value="3.0.40624.0" />
    <param name="autoUpgrade" value="true" />
    <a href="http://go.microsoft.com/fwlink/?LinkID=149156&v=3.0.40624.0" style="text-decoration:none">
      <img src="http://go.microsoft.com/fwlink/?LinkId=108181" alt="Get Microsoft Silverlight" style="border-style:none"/>
    </a>
     </object>

is encoded to:

<object width="100%" height="100%" data="data:application/x-oleobject;base64,QfXq3+HzJEysrJnDBxUISgAIAACTeAAAGhEAAAwAAAB3AGgAaQB0AGUAAAAAAAAAAAAAAAAAAAAuAAAAQwBsAGkAZQBuAHQAQgBpAG4ALwBDAG8AcAB5AFgAYQBtAGwALgB4AGEAcAAAADwAAAAAAAAAJgAAAG8AbgBTAGkAbAB2AGUAcgBsAGkAZwBoAHQARQByAHIAbwByAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAABAAAAAAAAAAAAAAAAAAAAGAAAADMALgAwAC4ANAAwADYAMgA0AC4AMAAAAAoAAAB0AHIAdQBlAAAAAAAAAAAAAAAAAAAA" type="application/x-silverlight-2" altHtml="
                   
    <a href="http://go.microsoft.com/fwlink/?LinkID=149156&v=3.0.40624.0" style="text-decoration:none">
      <img src="http://go.microsoft.com/fwlink/?LinkId=108181" alt="Get Microsoft Silverlight" style="border-style:none"/>
    </a>
     "/>

Therefore, IE has done something with the params in your case.   You'd better post your question here.  I will keep my eyes on this.  Thanks.

Best regards,

Jonathan

 

Jonathan Shen
Microsoft Online Community Support
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
  • Unanswered Question
  • Answered Question
  • Announcement