Go Back   Technology Questions > Hardware Questions > Mobile Computers > Tablet PC > Tablet PC - Sandbox (Chit Chat) > Tablet PC Bloggers

Tablet PC Bloggers Read Loren, Lora, and Layne's Blogs about Tablet PCs, UMPCs, and more.

Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old 05-04-2007, 05:10 PM
Administrator
 
Join Date: May 2004
Posts: 907
Loren is on a distinguished road
Post Silverlight JavaScript error in Firefox

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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

 
Old 05-04-2007, 05:10 PM
Xploder HD Movie Player for PS3. Manage, convert and transfer media files between the PC and PS3.
Reply

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


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


All times are GMT -8. The time now is 11:36 PM.


2003 - 2008 All Rights Reserved. Technology Questions

SEO by vBSEO 3.1.0