Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > problem with running javascript on firefox

Reply
Thread Tools

problem with running javascript on firefox

 
 
Paul Fi
Guest
Posts: n/a
 
      04-08-2006
im trying to change the width of an object dynamically, this i s the
object inside an html form

input
name="btnEmpty"
id = "btnempty"
type="button"
class=""
value=""

and the emptybutton class :

..emptybutton
{
color:#FFFFFF;
height:26px;
width:20px;
position:absolute;
cursor: default;
left: 1000px;
top: 115px;
}

i have added an event handler that gets called when the body of the html
is onload, the event handler is changewidth, this is the javascript code
for the event handler

function changewidth(){
var emptybutton = document.getElementById("btnempty");
style_emptybutton =
document.defaultView.getComputedStyle(emptybutton, '');
style_emptybutton.width =
document.body.offsetWidth-parseInt(style_emptybutton.left);
}

that code doesnt work in firefox and throws an exception when the last
instruction is ran:

Error: uncaught exception: [Exception... "Modifications are not allowed
for this document" code: "7" nsresult: "0x80530007
(NS_ERROR_DOM_NO_MODIFICATION_ALLOWED_ERR)" location:
"http://localhost/SmartOffice/Firefox/Home.js Line: 50"]

anyone knows what im doing wrong here

*** Sent via Developersdex http://www.developersdex.com ***
 
Reply With Quote
 
 
 
Reply

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 Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem on running clickonce applications in Firefox James Wong ASP .Net 2 02-22-2007 03:08 AM
Javascript code not running in FIREFOX Coder Javascript 7 06-07-2006 09:37 AM
modify a long-running python script while it is running? Benjamin Rutt Python 2 12-20-2005 01:42 PM
Running javascript function after page renders in firefox? cjl Javascript 4 07-07-2005 06:12 PM
I'm trying to network a deasktop running 98SE and a laptop running XP. Marc Computer Support 8 11-19-2003 03:01 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57