SitePoint Sponsor

User Tag List

Results 1 to 1 of 1
  1. #1
    SitePoint Guru
    Join Date
    Nov 2005
    0 Post(s)
    0 Thread(s)

    Jeopardy Game – Iframe not retaining JSON object


    My wife is a 3rd grade teacher and wanted a Jeopardy game she could use to review class concepts with her students. I realize I could have just created a PowerPoint game but since I am a web developer, I though I would create a browser based game. This game works except for when the user clicks refresh in IE7. Everything works in FireFox.

    To help explain how I implemented the logic of the game. The game is based on a JSON format file called jeopardyJSON. When the game loads, the jeopardyJSON file is used to create the Jeopardy board. Then the jeopardyJSON file is placed into an Iframe. As the user plays the game, every change updates the jeopardyJSON file and then places it back into the Iframe. If the user needs to go back, a history.back is executed against the Iframe and the jeopardyJSON file is retrieved from the Iframe. It seems to work really well.

    As explained earlier, I have one bug. If the user clicks the refresh button, the Iframe does not retain the JSON data (even though I did a proof of concept which proved it should be). Instead, IE7 gets a JavaScript error saying “Object Required”. I left my alerts in the code to help show where I was.

    If someone could help me determine why the Iframe is not retaining the JSON value that is placed in it, it would be much appreciated. Also, any other comments about the game would also be appreciated. I have been trying to improve my client side coding ability which is part of the reason I decided to code this for my wife (I also love her which is the biggest reason ).

    Thanks in advance for your time and knowledge.

    Attached should be all of the code required to execute the game.
    Attached Files Attached Files


Posting Permissions

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