|
| | |||||||
| 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 | |
| |
| | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Porblems Running JavaScript with IE6 or 7 but works fine on FireFox | remon87 | Internet Explorer | 14 | 03-28-2009 11:25 AM |
| Silverlight and firefox | Techno Mage | Windows Vista | 4 | 01-18-2008 05:40 AM |
| javascript error | Ian72434 | Internet Explorer | 1 | 12-07-2007 07:50 AM |
| Javascript error | AOR Fan | Windows XP | 2 | 10-21-2007 07:20 AM |
| Silverlight JavaScript error in Firefox | Loren | Tablet PC Bloggers | 0 | 05-04-2007 05:00 PM |
| New To Technology Questions? | Do You Need Help with Your Computer or Device? | Do You Need Help with this site? |