SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Member
    Join Date
    Apr 2005
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    A bit oSimple Javascript is crashing WebTV. Suggestions?

    We added some fairly simple javascript to our site last night, and now we're getting feedback from WebTV users that the page we modified is crashing their units.

    "Starting today, while playing non-fill-in-blank quizzes, I am cut off from your website and my WEB/TV computer shuts down. This occurs when I answer the first question. I press answer. Then, as I press "return" the shutdown occurs. "

    Sample page where crash occurs:

    http://www.funtrivia.com/playquiz.cfm?qid=150318

    The code that is causing the crash:

    <ul>

    <div onmouseover="answerOver(this);" onmouseout="answerOut(this);" onclick="selectAnswer(this);"><input name="q1" value="Mantua" type="radio" onclick="answerSelected(this);"> Mantua</div>

    <div onmouseover="answerOver(this);" onmouseout="answerOut(this);" onclick="selectAnswer(this);"><input name="q1" value="Verona" type="radio" onclick="answerSelected(this);"> Verona</div>

    <div onmouseover="answerOver(this);" onmouseout="answerOut(this);" onclick="selectAnswer(this);"><input name="q1" value="Padua" type="radio" onclick="answerSelected(this);"> Padua</div>

    <div onmouseover="answerOver(this);" onmouseout="answerOut(this);" onclick="selectAnswer(this);"><input name="q1" value="Siena" type="radio" onclick="answerSelected(this);"> Siena</div>

    </ul>

    And answerOver, answerOut, selectAnswer are very simple js functions located in http://www.funtrivia.com/playquiz.js

    Does anyone have any idea what might be crashing WebTV, and what we can do to protect against such crashes?

    Thanks

  2. #2
    SitePoint Enthusiast Dolbex's Avatar
    Join Date
    Jun 2003
    Location
    Confused USA
    Posts
    70
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    People use WebTV?

    Sorry, I looked through both playquiz.js and the code you provided here. Nothing stands out for me. Also, FireBug isn't returning any errors or warnings...

  3. #3
    SitePoint Member
    Join Date
    Jul 2004
    Location
    Chicago
    Posts
    15
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    << People use WebTV? >>

    lol, yep.

    And this problem is a real head scratcher to me... nothing looks odd to me.

  4. #4
    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)
    Hi snarf,

    A few thoughts...

    1. Don't use html comments in ".js" files.

    2. A UL can only have LIs as direct children. It cannot have DIVs as direct children.

    3. Always utilize the validator

    4. I'm a little suspicious of the event handling during bubbling in the code posted above. But I don't actually see anything incorrect.


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
  •