On Oct 16, 11:59 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > I am working on a live scoreboard, and most of it works, but the part > that doesn't is the most vital part of the scoreboard. I have a > Javascript on my server, athttp://www.nhlapp.com/scoreboard/scores.js > and the original Javascript is athttp://live.nhl.com/javascript/scores.js.
Like most of the scripts that you download from the web, that one is very, very ordinary: 1. try..catch is not a substitute for feature detection, it should ony be required once to establish your XMLHttpRequest object for IE. 2. All of those global variables should be properties of an object. 3. I would think that you are better off doing this in two steps: the first to update a "score" object, then another to update your DOM using that object. Only update the DOM if the score has changed. 4. Do not run 3 processes using independent setTimeouts, you will almost certainly get them out of order or end up with one conflicting with another. Synchronise them and use a single setInterval with say a 5 second lag. 5. The pointless "browser detection" thinks IE 6 is Firefox. Your page: <meta ... /> Do not pretend to use XHTML when you are serving text/html and without a doctype. <script languge="JavaScript"> The laguage attribute has been deprecated for many, many years. Type is required. <!-- HTML comments delimiters inside script elements are unnecessary and potentially disasterous if you ever serve your page as XML. -- Rob --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "iPhoneWebDev" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/iphonewebdev?hl=en -~----------~----~----~----~------~----~------~--~---
