Welcome guest, is this your first visit? Create Account now to join.
Results 1 to 5 of 5

This is a discussion on Buttons in html do not work. within the Bugs and Vulnerabilities section, part of the Google Chrome category: A forum I visit uses buttons to hide spoilers and large images, and chrome can only display the contents of ...


  1. #1
    retardedgenius is offline Junior Member
    Join Date
    Jun 2009
    Posts
    2

    Default Buttons in html do not work.

    A forum I visit uses buttons to hide spoilers and large images, and chrome can only display the contents of the first button appearing on a page, and does not open any others. Has anyone else encountered this, and is there a fix available?

    Here's an example, copied from the site in question.

    http://www.fiveeightforums.com/showp...&postcount=734

    (Sadly the photos are not mine!)

    Thanks for any help.

  2. #2
    Luc VN's Avatar
    Luc VN is offline Senior Member
    Join Date
    Sep 2008
    Location
    Belgium - Europe
    Posts
    758

    Default

    Correct, same problem here and works in IE7
    + the buttons do not change from "show spoiler" to "hide spoiler" when pressed.
    + only the first button on the page works, but without changing to "hide spoiler"

    You might want to post a bug?

  3. #3
    retardedgenius is offline Junior Member
    Join Date
    Jun 2009
    Posts
    2

    Default

    I have. I submitted it here too just to find out if anyone else had come across it.

  4. #4
    Kyrax is offline Senior Member
    Join Date
    Apr 2009
    Location
    Qc, Canada
    Posts
    495

    Default

    Ok, this shouldn't be done this way. All the button should do is apply a new class to its children div.

    It should toggle between two classes ("hidden-div" and "visible-div") for example. Using a javascript function declared earlier.

    Also, the script might want to use getElementsById('show') instead of getElementsByTagName('div')['show']

    Also, using multiple divs with the same id is never a good idea and can lead to errors. Use classes instead.

    But these are just some optimizations .. it wouldn't fix the problem.

    The real problem here lies in the "display" attribute of the div's style.

    In order to display something, you should use
    style.display = "block" (Not style.display = "", Chrome doesn't like that from my experience)

    In order to hide something, you should use
    style.display = "none"

    However, I'm quite sure the problem goes deeper than that and I doubt that this would fix the issue.
    If you have contact with the site's admin, I'd ask him to try to modify his scripts.

    I do not think that this is Chrome's fault. I think that it's a problem with different interpretation of the same javascript.

  5. #5
    PeterR is offline Junior Member
    Join Date
    Jun 2009
    Posts
    5

    Default

    Using the Dev 3.0.187.1 build I see the same behaviour. It also does work in FF, and surprisingly without any console reported errors.

    I agree with Kyrax's take on this, but the fact that it works on the first one (text change withstanding) and not on the second seems to imply it has something to do with the way the objects are nested in the DOM's object model. That smacks of being an actual bug. Although, in all fairness to Chrome, better JavaScript syntax would probably solve the problem.

Similar Threads

  1. Access inner html of page of active tab
    By Gaurang033 in forum Plugins Development
    Replies: 15
    Last Post: 05-16-2011, 10:51 AM
  2. Windows buttons don't work in Chrome
    By cappyq in forum Bugs and Vulnerabilities
    Replies: 10
    Last Post: 06-16-2010, 02:07 PM
  3. HTML 5 <video> tags or the end of Flash
    By Luc VN in forum Chrome Tech
    Replies: 4
    Last Post: 03-23-2010, 06:32 AM
  4. HTML Home
    By ducktape in forum Chrome Tips & Tricks
    Replies: 12
    Last Post: 04-15-2009, 12:26 AM
  5. Back / forward buttons on mouse
    By Illway in forum Bugs and Vulnerabilities
    Replies: 1
    Last Post: 03-26-2009, 11:55 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •