AJAX package for carterlake templates FAQ - 13-Jan-2006 Q: How do I mark up my own page for AJAX variable substitution? A: Enclose a WD %tag% with the equivalent AJAX id= values (shown below). Example: %temp% You need to have only ONE instance of id=".." used in the page (HTML rule.. one unique id value/page). All the AJAX marked tags must have class="ajax" attribute so the 'green-flash' will work. Q: What other WD variables are available? A: the stock variables included in the JavaScript can be seen as the first argument to each of the set_ajax_obs("ajax...",) calls. Here's the list for reference: Tagname : function/variable ----------------Temperature / Humidity -------------------------- ajaxtemp : outside temperature ajaxbigtemp : outside temperature with no decimal point ajaxtemparrow : outside temperature trend arrow (rising/falling) ajaxtemprate : temperature rate (+/-)/hour ajaxtempmin : minimum temperature for the day ajaxtempmax : maximum temperature for the day ajaxhumidity : current outside humidity in percent ajaxdew : current dew point ajaxdewmin : minimum dew point for the day ajaxdewmax : maximum dew point for the day ajaxhumidex : current humidex ajaxhumidexmin : minimum humidex for the day ajaxhumidexmax : maximum humidex for the day ajaxwindchill : current windchill ajaxwindchillmin : minimum windchill for the day ajaxwindchillmax : maximum windchill for the day ajaxheatidx : current heat index ajaxheatidxmin : minimum heat index for the day ajaxheatidxmax : maximum heat index for the day ajaxfeelslike : the current 'feels like' temperature (windchill, temperature, or heatindex based on current temperature. ajaxapparenttemp : current apparent temperature ajaxapparenttempmin : minimum apparent temp for the day ajaxapparenttempmax : maximum apparent temp for the day ---------------- pressure ----------------------------------- ajaxbaro : current pressure ajaxbarotrend : current pressure trend (+/-) ajaxbaroarrow : of rising/falling for barotrend ajaxbarotrendtext : text (Falling rapidly, Falling Slowly, Steady, Rising Slowly, Rising Rapidly) ajaxbaromin : minimum pressure for the day ajaxbaromax : maximum pressure for the day ---------------- wind ----------------------------------- ajaxwind : current wind speed (or 'Calm' if wind < 0.1 ) ajaxwinddir : current wind direction (or blank if wind < 0.1 and gust < 0.1) ajaxwindicon : for wind direction (or "" if wind < 0.1 and gust < 0.1 ) ajaxbeaufort : Beaufort Scale text for current wind ('Calm' .. 'Hurricane') ajaxgust : current gust speed (or 'None' if gust < 0.1) ajaxmaxgust : max gust speed for the day ajaxwindmaxavg : maximum average wind speed for the day ---------------- Solar/UV ----------------------------------- ajaxsolar : solar w/m2 (for Davis VP+) ajaxsolarpct : solar percent of max solar for time/lat/long.(for Davis VP+) ajaxuv : uv index (for Davis VP+) ajaxuvword : "none" or formatted string about current uv index intensity ---------------- Rain ----------------------------------- ajaxrain : rain today ajaxrainydy : rain yesterday ajaxrainmo : rain for this month ajaxrainyr : rain for this year ajaxrainratehr : current rain rate /hour ---------------- Date/Time ----------------------------------- ajaxdatetime : formatted mm/dd/yyyy hh:mm:ss[am|pm] ajaxdate : formatted as mm/dd/yyyy ajaxtime : formatted as hh:mm:ss[am|pm] ---------------- Miscellaneous ----------------------------------- ajaxindicator : will flash text enclosed in with flashcolor every time the ajaxLoader script is run (even if no conditions have changed). Used as a 'I'm getting the data' indicator. ajaxconditionicon : of WD current condition icon from imagedir ajaxcurrentcond : text description .. %weathercond% %Currentsolardescription% with \s replaced by comma ajaxcloudheight : current estimate of cloud height based on temp / humidity / pressure All of the above are optional for use, so leave out ajaxsolar, ajaxsolarpct, ajaxuv if you don't have those sensors installed. Q: How do the arrows go in? A: A routine is included in the JavaScript for rising/falling arrow HTML generation, and all the WD variables that have trend info in clientraw.txt have rising/falling arrows generated. One example is coded around the ajaxtemparrow. Q:I have also seen mention of a few js files. Do I need these and where do I get them from? A:Some folks have put their AJAX script in a .js file rather than including it inline in the page. You don't need any other JavaScript to make the AJAX work. Q: anole's weather sticker icon set - where can I get these from? A: you can download the PHP weather sticker set from anole's website http://scripts.anolecomputer.com/download.shtml . It's the wxsticker.zip file. Larry has allowed the .gif versions of his icons to be distributed in this package (in ./ajax-images ) Q: What if there's a WD %tag% that's not in the AJAX script? Can I add it? A: Sure, if the condition also appears in clientraw.txt uploaded by WD, you can add it. use http://www.tnetweather.com/wd-parser.php to see clientraw decoded. Q: I broke the script with changes to the JavaScript. How can I debug it? A: Best bet is to use Firefox with the Web Developer and FireBug plugins. A veritable Swiss-Army knife of goodies to help web page developers. http://www.mozilla.com/firefox/ and look for Web Developer and FireBug plugins in the Addons area. Q: My ajaxcounter just counts up and never resets, and my ajaxtime looks strange too. How can I fix that? A: Check the WD Control Panel, Web Files/Web Page setup, Real-time FTP tab for the 'Your weather name to appear in the client viewer/real time avg web page' text area .. make sure no dash ('-') characters appear. If they do, replace them with a comma or a slash (anything but a dash or an underscore) and press OK to save the new setting. A dash in the field is used to separate the text station name from the current time in clientraw[32]. Q: I look at my page in IE and the homepage conditions overflows the right side of the template. It looks fine in Firefox. What's up with that? A: (from carterlake) : Template users should disable the extra META data feature of WD. To do so... untick the option "Have the raw weather data to appear in your webpage for others to use" which is found in Setup... Advanced/Misc Settings...