<html> <head> <title>Display Date</title> <!-- Define Loaded event handler for TextBlock. --> <script type="text/javascript"> function setDate(sender, eventArgs) { sender.text = Date(); } </script> </head>
<body bgcolor="Teal">
<!-- Define XAML content. --> <script type="text/xaml" id="xamlContent"><?xml version="1.0"?> <Canvas xmlns="http://schemas.microsoft.com/client/2007" Background="Wheat"> <TextBlock Canvas.Left="20" FontSize="24" Loaded="setDate" /> </Canvas> </script>
<div id="silverlightControlHost"> <object type="application/x-silverlight" width="100%" height="100%" id="slc"> <param name="source" value="#xamlContent"/> <param name="onload" value="onLoaded" /> <param name="iswindowless" value="true" /> </object> <iframe style='visibility:hidden;height:0;0;border:0px'></iframe> </div> </body> </html>
内嵌入javascript的xaml感觉上xaml的复杂度停留在1.0的样子 可以直接通过silverlight 插件进行解析
顺带说明跨浏览器不能识别 ie 是没啥问题
|