Progressive enhancement with Silverlight

Can I detect with Javascript if the client has the necessary runtime to launch the Silverlight section on the page and load if, if they do, otherwise leave a static image or something in this area?

I would like to add Silverlight to the page, but this is not an important part of the page, so I would rather just silently return to the clean web-standard materials if they are not installed, and do not put something that asks them to install it.

+3
source share
1 answer

A standard example page, such as the one built at launch of the silverlight application from visual studio, handles this for you.

   <object data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="100%" height="100%">
      <param name="source" value="SilverlightApplication1.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>

Note that when an object tag is unable to instantiate an object associated with a type, it displays internal html instead. In this way, you can modify the internal html to show what you ever consider a suitable reserve.

+4
source

Source: https://habr.com/ru/post/1717183/


All Articles