| |||||||
| Tablet PC Bloggers Read Loren, Lora, and Layne's Blogs about Tablet PCs, UMPCs, and more. |
![]() |
| | LinkBack | Thread Tools |
| |||
| I've been tinkering with a tiny Silverlight app, and I kept running into the situation where the code would work in IE and Safari, but not Firefox. Turns out I was using some older sample code as a guide that had a problem. In particular, when creating the silverlight object, I was using code like this: Sys.Silverlight.createObjectEx({source:'page.xaml' , parentElement: agControlHost, id:'silverlightObj', properties: { width:'300', height:'200', background:'#ffffffff', isWindowless: 'false', framerate:'24', version:'0.8' }, events: { onError:null, onLoad:null }, context:null }); Unfortunately, I kept getting an error that the parentElement agControlHost didn't exist. It took me awhile to realize that I needed to use getElementById() instead of using the element's name by itself to fix the problem. Here's the correct way to create a silverlight object: Sys.Silverlight.createObjectEx({source:'page.xaml' , parentElement: document.getElementById('agControlHost'), id:'silverlightObj', properties: { width:'300', height:'200', background:'#ffffffff', isWindowless: 'false', framerate:'24', version:'0.8' }, events: { onError:null, onLoad:null }, context:null }); Now my Silverlight experiment works just fine in IE, Firefox, and Safari. Incremental Blogger |
![]() |
| Bookmarks |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Silverlight JavaScript error in Firefox | Loren | Tablet PC Bloggers | 0 | 05-04-2007 04:00 PM |
| If Silverlight won't run in IE, try this | Loren | Tablet PC Bloggers | 0 | 05-01-2007 09:40 PM |
| Ink in Silverlight | Loren | Tablet PC Bloggers | 0 | 05-01-2007 09:40 PM |
| Re: Flash & Javascript Error Message | Spikey | Windows XP | 0 | 01-04-2007 01:46 AM |
| Re: Javascript error | sangeethavani12@gmail.com | Windows XP | 0 | 01-04-2007 01:45 AM |