bug in Firefox???

This is a discussion on "bug in Firefox???" within the JavaScript Forum section. This forum, and the thread "bug in Firefox??? are both part of the Program Your Website category.



 Subscribe in a reader

Go Back   Webforumz.com > Main Forums > Program Your Website > JavaScript Forum

Notices


Reply
 
LinkBack Thread Tools
  #1  
Old Mar 11th, 2008, 22:15
Up'n'Coming Member
Join Date: Sep 2005
Location: athens
Age: 26
Posts: 60
Thanks: 0
Thanked 0 Times in 0 Posts
bug in Firefox???

Hello,
I have a js function that is triggered with the onclick event. In particular, there is a <tr> in a table that is shown when the user clicks on the "Show" button.

In HTML I have:
Code: Select all
<tr>  <td>
    <img id="myimage" src="css/images/show.png"           onclick="javascript:HideShow('myrow');"/>
   </td>
</tr><tr id="myrow" style="display:none">
      <td>Hello all!
      </td>
</tr>
and the JS part is:

Code: Select all
<script type="text/javascript">
function HideShow(myVar) 
          { 
                if (document.getElementById(myVar).style.display == 'none') 
                { 
                    document.getElementById(myVar).style.display = 'inline'
                } 
                else 
                { 
                    document.getElementById(myVar).style.display = 'none'
                }
          } 
</script>
The function works fine, that is, when the user clicks on the image, the tr appears and then, if the user clicks again, it disappears... BUT all these work perfectly with IE, whereas in Firefox, the contents of the tr appear and disappear when the image is clicked, however, when the user clicks twice, the "Hello world" data disappears, but a blank row remains...And, if you do that again and again, I end up with as much blank rows as the times that I click the button for the data to disappear...

Is this something like a bug? Can I do anything else?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote

  #2  
Old Mar 12th, 2008, 03:34
frinkky's Avatar
Super Moderator
Join Date: Oct 2006
Location: Southampton
Age: 30
Posts: 351
Blog Entries: 2
Thanks: 2
Thanked 6 Times in 6 Posts
Re: bug in Firefox???

a
Last Blog Entry: Fobriwap! (Mar 10th, 2008)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3  
Old Mar 12th, 2008, 20:11
CloudedVision's Avatar
Moderator
Join Date: Feb 2008
Location: In My Own Little World
Age: 14
Posts: 1,248
Blog Entries: 9
Thanks: 2
Thanked 40 Times in 40 Posts
Re: bug in Firefox???

i completely agree with frinkky

i think was frinkky was trying to communicate was that instead of doing

Code: Select all
<img id="myimage" src="css/images/show.png"           onclick="javascript:HideShow('myrow');"/>
you should do

Code: Select all
<a href="#" onclick="javascript:HideShow('myrow');"><img src="css/images/show.png" name="myimage" border="0" id="myimage" /></a>
It worked fine for me with that
__________________
Web Design And Development: Other Road Design | Problems with IE6?: KApp | My Blog: Only Nerds Allowed | Learning PHP? Lessons
Last Blog Entry: Hilarious Rapper (Jul 29th, 2008)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4  
Old Mar 12th, 2008, 22:47
frinkky's Avatar
Super Moderator
Join Date: Oct 2006
Location: Southampton
Age: 30
Posts: 351
Blog Entries: 2
Thanks: 2
Thanked 6 Times in 6 Posts
Re: bug in Firefox???

Very perceptive of you CV

I hadn't actually meant to post on this topic at all.
Last Blog Entry: Fobriwap! (Mar 10th, 2008)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #5  
Old Mar 12th, 2008, 22:55
saltedm8's Avatar
SuperMember

SuperMember
Join Date: Nov 2005
Location: here
Age: 27
Posts: 1,522
Blog Entries: 2
Thanks: 1
Thanked 11 Times in 11 Posts
Re: bug in Firefox???

hillerious, thanks for the making my day !!
Last Blog Entry: Strict and Transitional Doctype's (Sep 12th, 2008)

Last edited by saltedm8; Mar 12th, 2008 at 22:57.
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

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
Firefox Vs IE7 (CSS) Monie Web Page Design 9 Sep 20th, 2007 02:37
Useful Firefox Add-ons Antwan Webforumz Cafe 19 Feb 21st, 2007 16:02
alt tag in Firefox afuller Web Page Design 8 Dec 9th, 2006 19:16
Need help regarding firefox vs. ie james@thecultureofme Web Page Design 5 Jun 2nd, 2006 14:32
IE ok, Firefox no way lizarddoctor Web Page Design 4 Nov 27th, 2005 23:35


All times are GMT. The time now is 05:57.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

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