Debugging JavaScript can be a real pain because ALL the JavaScript stops executing when an error is encountered, so you have to be very careful with syntax, and use a good debugger plugin (like FireBug for Firefox browser).
So, you'd said previously you wanted to change the dashboard to use the UV icon .. now it's the gizmo instead? The same caution applies, and even more so in the ajax-gizmo as little vertical space is available in the gizmo area for an icon .. only images of about 12px high could be used there.
Display and update of a page in the viewer's browser is a two-step process (with the second step depending on the viewer's browser allowing JavaScript to run from your website):
Step 1: the webserver loads and executes all the PHP code in the page, and the resulting PHP print/echo statements (if any) replace all the <?php ... ?> areas you can see on the page. The fully executed page is returned to the viewer's browser as pure HTML and text.
Step 2: (if viewer's browser has JavaScript enabled) the AJAX scripts are loaded by the viewer's browser, and executed in the viewer's browser. The script will replace the contents of the displayed HTML page for sections with markup like
<span class="ajax" id="ajax...."> ... </span> with computed contents from your realtime file. The JavaScript only replaces the marked-up sections in the display on the browser.. not the 'real' page from the server. Updates this way will continue until either a specified number of updates occur, or a fatal JavaScript error is encountered.
Since a lot of folks have JavaScript turned off when they first visit a site, it's important to present the current page fully rendered by the PHP code. Then you can add 'spice' by having JavaScript update the contents of the displayed page based on more current data from a realtime file.
The JavaScript counter is enabled for display on the page if JavaScript is allowed by the browser. The counter will automatically reset when a newer realtime file is successfully loaded and displayed. If the AJAX script has an update limit, then the counter will not be reset after the last update was displayed.
If you visit the page (by doing a reload, not just looking at the old page in your browser), it will use a 'current' PHP image, load the AJAX script and start the update process.
Keep in mind that what you see on the status page is produced only by the webserver using PHP at the time the page is first loaded into the browser .. it is NOT updated by any of the AJAX JavaScripts. The AJAX JavaScripts only run in the browser so can only process the data they can see (the realtime file).
Hope this helps ... many folks find that learning PHP and JavaScript is at least half the fun of the weather enthusiast hobby, so I tend to encourage folks to use my scripts as a starting point for their own learning and enhancement of their personal weather website. PHP tends to be easier to debug and add enhancements since PHP errors are clearly shown (so you can correct the code and move on). JavaScript changes, especially to the AJAX routines are more challenging and harder to debug (given JavaScripts 'silent stop' method). My recommendation is to try doing all of what you want by changing the PHP and HTML markup code first, get a good result, then moving on to the AJAX mods. For UV display, I'm not sure that having a every-few-seconds update of UV index is meaningful, so having just the PHP version makes more sense to me -- AJAX updates are intended to make the page 'current' without refreshing the whole page. Not all the weather condition values are available in the realtime files, so it's a good idea to have folks reload the page at the same interval that the PHP conditions are updated (every 5 minutes).
Best regards,
Ken