Submit Your Article Webforumz RegistrationAnnouncements Contact Webforumz StaffContact
Home Resources Blogs Meet the Team Contact Register
 

Go Back   WebForumz.com > The Code > JavaScript

Reply
 
LinkBack Thread Tools
Old October 19th, 2008, 11:53 PM   #1
New Member
 

Join Date: Oct 2008
Location: Canberra Australia
Age: 28
Posts: 6
Thanks: 1
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 Hootinanny is on a distinguished road
Question Firefox doesn't like my javascript

I have very simple javascript within my html (processing as asp page).
JS:
HTML Code:
<script type="text/javascript">
document.getElementById['image'].style.height = document.getElementById['itAlerts'].offsetHeight;
</script>
The script sits within the body. Does anyone know what I'm doing wrong? If I do document.all - it works in IE but not Firefox.

Last edited by Marc; October 20th, 2008 at 04:08 AM.. Reason: added [html] tags.
Hootinanny is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old October 21st, 2008, 05:42 PM   #2
Most Reputable Member
 

Join Date: Feb 2008
Location: In My Own Little World
Age: 16
Posts: 1,345
Blog Entries: 9
Thanks: 2
Thanked 45 Times in 45 Posts
Rep Altering Power: 0 CloudedVision is on a distinguished road
Re: Firefox doesn't like my javascript

it should be document.getElementById('iAlerts')..... getElementById is a function, not an array. you should also fix the first getElementById.
__________________
Theron Luhn
CloudedVision is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old October 21st, 2008, 07:00 PM   #3
New Member
 

Join Date: Oct 2008
Location: Canberra Australia
Age: 28
Posts: 6
Thanks: 1
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 Hootinanny is on a distinguished road
Re: Firefox doesn't like my javascript

Thanks, I changed my brackets and discovered I needed to specify that the height was in pixels and it is working now!

Cheers.
Hootinanny is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Bookmarks

Tags
document.getelementbyid , firefox browser , javascript


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
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
What's Firefox doing to my javascript?! mpnuttall JavaScript 3 September 24th, 2008 03:19 PM
Some javascript not working in Firefox jonnymorris HTML, XHTML and CSS 4 September 18th, 2007 10:02 AM
Some javascript not working in Firefox jonnymorris JavaScript 4 September 18th, 2007 06:47 AM
Javascript Navigation Will Not Work With Firefox cpando1974 JavaScript 2 April 1st, 2007 10:56 AM
Firefox Javascript problem Darkink JavaScript 9 February 6th, 2007 06:20 PM


Search Engine Optimization by vBSEO 3.2.0 RC8