I am always looking for a jQuery plugin to embed Silverlight application in web pages, and the most close thing I found is
jQuery media plugin, a general purpose plugin for Flash, Quicktime, Windows Media Player, Real Player, MP3, Silverlight, which missing some basic features (ex: default error handling function) for Silverlight.
So, I just wrote
my own plugin for Silverlight 3 application embedding, welcome for feedback.
Please mark the replies as answers if they help or unmark if not.
If you have any feedback about my replies, please contact msdnmg@microsoft.com.
Microsoft One Code Framework
darkthread
Member
1 Points
5 Posts
jQuery Plugin for Silverlight 3 embedding
May 20, 2010 11:05 PM | LINK
I am always looking for a jQuery plugin to embed Silverlight application in web pages, and the most close thing I found is jQuery media plugin, a general purpose plugin for Flash, Quicktime, Windows Media Player, Real Player, MP3, Silverlight, which missing some basic features (ex: default error handling function) for Silverlight.
So, I just wrote my own plugin for Silverlight 3 application embedding, welcome for feedback.
jquery silverlight
Jonathan She...
All-Star
50156 Points
4951 Posts
Microsoft
Re: jQuery Plugin for Silverlight 3 embedding
May 26, 2010 07:51 AM | LINK
Hi Darkthread,
//jQuery Plugin for Silverlight 3 Embedding//Ver 0.9 by Jeffrey Lee, http://blog.darkthread.net(function ($) {if (!window.onSilverlightError) {window.onSilverlightError = function (sender, args) {var appSource =(sender != null && sender != 0) ?appSource = sender.getHost().Source : "";var errorType = args.ErrorType;var iErrorCode = args.ErrorCode;return;var errMsg = [];errMsg.push("Unhandled Error in Silverlight Application " + appSource);if (args.lineNumber != 0) {//seed for unique function nameif (!window.dtsl_FuncUid)$.fn.insertSilverlight = function (source, options) {var defaults = {onError: "onSilverlightError",background: "white",minRuntimeVersion: "3.0.40818.0",autoUpgrade: "true",enableHtmlAccess: "true",initParams: null,splashScreenSource: null,onSourceDownloadProgressChanged: null,onSourceDownloadComplete: null,onLoad: null,onResize: null,windowless: false,width: "100%",height: "100%"var settings = $.extend(defaults, options);var a = [];a.push('<param name="onError" value="onSilverlightError" />');var v = settings[p];//event callbacka.push('<img src="http://go.microsoft.com/fwlink/?LinkId=108181" alt="Get Microsoft Silverlight" style="border-style:none"/>');a.push('</a>');a.push('</object>');a.push('<iframe id="_sl_historyFrame" style="visibility:hidden;height:0px;width:0px;border:0px"></iframe>');If you have any feedback about my replies, please contact msdnmg@microsoft.com.
Microsoft One Code Framework