| |||||||
| 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 parentElement didn't exist. It took me awhile to realize that I needed to use getElementById() instead to fix the problem: 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 |
| If Silverlight won't run in IE, try this | Loren | Tablet PC Bloggers | 0 | 05-02-2007 07:20 AM |
| 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 |