Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6541019
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T11:03:08+00:00 2026-05-25T11:03:08+00:00

I have a web application that uses jQuery to dynamically create an silverlight object.

  • 0

I have a web application that uses jQuery to dynamically create an silverlight object.

This works well in Chrome and Firefox, but not in IE9.

Here’s a jsFiddle which demonstrates this: http://jsfiddle.net/Bx9we/5/
In this example, the link to the .XAP file is fake, but your browsers should at least display the orange background. (In the actual application I’m working on the .XAP file is real and does display properly in Chrome and Firefox).


A possible red herring:

I’m looking at the generated HTML using the F12 developer tools. In firefox and chrome, it looks like this:

<object 
       data="data:application/x-silverlight-2," 
       type="application/x-silverlight-2" 
       id="SilverlightControl" height="292" width="396">
       <!-- continued --!>

But in IE9, it has transformed the data field into a different value.

   <object 
       id="SilverlightControl" 
       data="data:application/x-oleobject;base64,QfXq3+HzJEysrJnDBxUISgAJAADtKAAALR4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAPAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=" 
       width="396" 
       type="application/x-silverlight-2" 
       height="292">
          <!-- continued --!>

The transformation of the data tag is discussed in this question.


Just in case jsFiddle isn’t running:

The CSS

div.overlaid
{
    border:3px solid darkgray;
    background:black;
    height:312px;
    width:396px;
    position:absolute;
    top:50px;
    left:50px;
}
.videoPopupCloseLink
{
    position:absolute;
    bottom:6px;
    right:6px;
    color:White;
}

THE HTML

<button id="createOverlay">Create Overlay</button>

and the javascript:

$(function()
  {
      $('div.overlaid').remove();
      $('#createOverlay').click(function() {
            var div = $('<div />')
                .addClass('overlaid')
                .appendTo('body');

            var silverlightSource = './dummy_source.xap';
          var fileName='buy_duff_beer.wmv';
          var entityId=39874;
           var initParams = '<param id="initParams" name="initParams" value="fileName=' + fileName + ',entityid=' + entityId + '" />';
        $('<object data="data:application/x-silverlight-2," type="application/x-silverlight-2" id="SilverlightControl" height="292" width="396" />')
                            .append($('<param></param>').attr({ name: "source", value: silverlightSource }))
                            .append("<param name='background' value='orange' />")
                            .append("<param name='onerror' value='onSilverlightError' />")
                            .append("<param name='minRuntimeVersion' value='4.0.50826.0' />")
                            .append("<param name='autoUpgrade' value='true' />")
                            .append(initParams)
                            .append('<a href="http://go.microsoft.com/fwlink/?LinkID=149156&v=4.0.50826.0" style="text-decoration:none"><img src="http://go.microsoft.com/fwlink/?LinkId=161376" alt="Get Microsoft Silverlight" style="border-style:none"/></a>')
                            .appendTo(div);

         $('<a />')
                    .addClass('videoPopupCloseLink')
                    .text('close')
                    .click(function () { $('div.overlaid').remove() })
                    .appendTo(div);
}
    );
}
);
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T11:03:09+00:00Added an answer on May 25, 2026 at 11:03 am

    Well it works, if you use correct html:
    http://jsfiddle.net/Bx9we/7/

    When creating an object tag in IE, you can not create it then add it to the dom
    in 2 operations. You have to create the object tag in an html string, then add the string to the dom.

    $(‘some html’).appendTo first creates the dom node – which won’t work for object tag in IE.

    $(function() {
    $('div.overlaid').remove();
    
      $('#createOverlay').click(function() {
    
    var silverlightSource = './dummy_source.xap';
    var fileName='buy_duff_beer.wmv';
        var entityId=39874;
    
    $("body").append('<div class="overlaid"><object data="data:application/x-silverlight-2," type="application/x-silverlight-2" id="SilverlightControl" height="292" width="396" >\
          <param name="source" value="'+silverlightSource+'"></param>\
          <param name="background" value="orange" ></param>\
          <param id="initParams" name="initParams" value="fileName=' + fileName + ',entityid=' + entityId + '" ></param>\
          </object></div>\
          ');
    
      });
    

    });

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a web application that uses the current version of JQuery that needs
I have an ASP.NET web application that uses jQuery on client side. On one
I have an existing ASP.NET web application. This ASP.NET web application uses JQuery to
I have a silverlight web application that maybe open for days. It uses a
I have a web application that uses Ext-JS 2.2. In a certain component, we
We have a java web service application that uses log4j to do logging. An
I have a Dynamic Data Entities Web Application that uses a database with GUIDs
I have a winform application that uses some referenced web services to get data.
I have this web application that has grown to an unmanageable mess. I want
I need to debug a web application that uses jQuery to do some fairly

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.