SitePoint Sponsor

User Tag List

Results 1 to 12 of 12
  1. #1
    SitePoint Member
    Join Date
    Nov 2006
    Posts
    21
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    javascript problems in Opera

    i have a problem only in opera
    www.f1racing.ws or www.f1racing.us

    If you view it with Opera you will find out what the problem is. The question is what can i do to that countdown? I found that the countdown JS is the problem, when setting the innerHTML or the setTimeout.

    Any help is appreciated.

  2. #2
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    Join Date
    Jul 2005
    Location
    West Springfield, Massachusetts
    Posts
    17,169
    Mentioned
    190 Post(s)
    Tagged
    2 Thread(s)

    countdown

    What version of Opera are you using? I checked out the pages with ver 9.02 and it seems to be working OK. No javascript errors.

  3. #3
    I'll take mine raw silver trophy MikeFoster's Avatar
    Join Date
    Dec 2002
    Location
    Alabama, USA
    Posts
    2,560
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

  4. #4
    SitePoint Member
    Join Date
    Nov 2006
    Posts
    21
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i am using the latest version, 9.02
    I think you noticed that space between the header and content...
    Is damn BIG BLANK space!!!!!

  5. #5
    I'll take mine raw silver trophy MikeFoster's Avatar
    Join Date
    Dec 2002
    Location
    Alabama, USA
    Posts
    2,560
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    gurde, you need to fix your sloppy html. Do you see this BIG LINK? Click on it.

  6. #6
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    Join Date
    Jul 2005
    Location
    West Springfield, Massachusetts
    Posts
    17,169
    Mentioned
    190 Post(s)
    Tagged
    2 Thread(s)

    javascript

    Sorry, this is the javascript forum, and when you said
    Quote Originally Posted by gurde_com
    the countdown JS is the problem,
    I thought you meant it wasn't working. Often forum members will be working on a page with several problems and tackle them one by one, so I didn't think you were talking about your mark-up and CSS mess. Opera handles standards mark-up well, so you should take MikeFoster's suggestion and valdate first. It may be that even with valid HTML and CSS that Opera won't like doing innerHTML with all the tables and divs. But it definately won't like replacing portions of the DOM when they aren't clearly defined.

  7. #7
    SitePoint Member
    Join Date
    Nov 2006
    Posts
    21
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If i comment the setTimeout or innerHTML it all workes great. So i doubt that my html is the problem.

    reference to entity "read" for which no system identifier could be generated - since when the & is a problem to have it inside a link? as usual this validation is good for nothing

    Instead i would really like to know what is going wrong with the innerHTML and setTimeout. Remember, commentig all the innerHTML part is working great OR commentig the setTimeout is working again. Then again i doubt that my html has something to do with it.

    I also read on other forums that Opera has a lot of bugs with JS.

  8. #8
    I'll take mine raw silver trophy MikeFoster's Avatar
    Join Date
    Dec 2002
    Location
    Alabama, USA
    Posts
    2,560
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    gurde, the validation errors you need to first be concerned about are these:

    end tag for element "B" which is not open.
    end tag for element "I" which is not open.
    end tag for element "U" which is not open.
    document type does not allow element "TR" here.
    document type does not allow element "TR" here.
    "TR" not finished but containing element ended.
    "TR" not finished but containing element ended.

    It should be fairly easy to fix these. Why should we waste our time debugging your code when you won't fix obvious errors that may indeed be the source of the problem?

  9. #9
    SitePoint Member
    Join Date
    Nov 2006
    Posts
    21
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    fixed the TR problems, that was not the problem and i think not even the bold italic or underline would be the problem

    again, i found that innerHTML or setTimeout is the problem, so could you please explain why is not working as it should? if the countdown script is commented the page looks all good

    so please try to help me fix that countdown

  10. #10
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    Join Date
    Jul 2005
    Location
    West Springfield, Massachusetts
    Posts
    17,169
    Mentioned
    190 Post(s)
    Tagged
    2 Thread(s)

    poor mark-up

    Although it should be easy enough to use your editor's "replace all" to change the &s to &s I suspect the problem has more to do with these errors
    # Error Line 117 column 587: end tag for element "B" which is not open.
    # Error Line 117 column 591: end tag for element "I" which is not open.
    # Error Line 117 column 595: end tag for element "U" which is not open.
    Or it could simply be that the mess of table tags has an error in it somewhere. Cleaning up the amps would make it easier to locate the real culprit(s).
    The problem is not with the javascript, but it's because the script works the DOM and the DOM is broken.
    Like it or not, doubt all you will, but you need to fix your mark-up.

  11. #11
    I'll take mine raw silver trophy MikeFoster's Avatar
    Join Date
    Dec 2002
    Location
    Alabama, USA
    Posts
    2,560
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Mittineague is right. One of the table rows has only one TD whereas the other rows in that table have two TDs. That may not be the source of the problem - but it can't be good

    But I think I've found something. You're using table layout everywhere except on those DIVs that get dynamically updated, and you have those "floated". That is where the problem is. It would be better to make them SPANs. But here is the quick change I made just to verify if I'd found the problem:
    Code:
    .countdown div{
      font-size:17px;
      font-weight:bold;
    /*  float:left;  */
      display:inline; /* added by mf */
    }
    Remove the float and just make it inline. It's hard for me to test the complete page offline so you try it and see if it works

    These kinds of problems are rarely due to Js alone - but usually due to some combination of html/css/js.

  12. #12
    SitePoint Member
    Join Date
    Nov 2006
    Posts
    21
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    MikeFoster, thanks!
    display:inline; - worked

    so after all it was CSS not JS

    and as usual... "Every solution breeds new problems." (Murphy Law)


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
  •