SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Jan 2010
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Cross-Browser JavaScript problem (Gecko vs. Webkit)

    So, I'm building a web page that will display multiple carousels of products based on the contents of a JSON object. The JavaScript is structured in such a way that, upon complete loading of the DOM, it iterates through arrays of my products and builds the initial set of items that will be displayed within the carousels. This work just fine in Firefox and IE. The only problem is that Webkit browsers--namely, Chrome and Safari--are initializing all carousels to display only the information from the very last array of products. So, Firefox and IE initialize the page thus:


    Carousel 1
    A,A,A,A

    Carousel 2
    B,B,B,B

    Carousel 3
    C,C,C,C

    Carousel 4
    D,D,D,D

    Carousel 5
    E,E,E,E


    . . . whereas Chrome and Safari initialize the page in this fashion:

    Carousel 1
    E,E,E,E

    Carousel 2
    E,E,E,E

    Carousel 3
    E,E,E,E

    Carousel 4
    E,E,E,E

    Carousel 5
    E,E,E,E


    Does anyone know what could be causing this?

  2. #2
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,729
    Mentioned
    104 Post(s)
    Tagged
    4 Thread(s)
    Quote Originally Posted by ExNihil View Post
    Does anyone know what could be causing this?
    We might be able to work it out, if we were able to play around with a test page that demonstrates the problem.
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript

  3. #3
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,863
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    If you can't provide a link to a test page then providing a copy of the code would be the next best alternative.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">


Bookmarks

Posting Permissions

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