Technology Questions

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, 06:10 PM
Administrator
 
Join Date: May 2004
Posts: 1,140
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, 06:10 PM
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
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?

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


2003 - 2009 All Rights Reserved. Technology Questions

Search Engine Friendly URLs by vBSEO 3.3.0