Although I do not have time nor inclination to investigate properly, from a quick look using web developer tools in Firefox, it appears that the 'a year ago' script is probably failing at the 'split' instruction shown in context below. That split instruction was present in DAJ's original Annual data summary routine and apart from changing its context, I use it as the only way I know to separate out the rows, and subsequently date components and fields in dayfile.txt.
Can anyone explain why the browsers behave differently with the same script when using local filespace? I note that Firefox claim their latest release is complaint with a particular ECMA script standard. Is there a change in jQuery or a change in permitted function commands? I do have add-ons installed in my Firefox and Chrome, but I have tried this in SRWare Iron, Avant, IceDragon and Lunascape6 with the same result - it does seem to be linked to the browser engine differences. Can anybody suggest alternative coding that all script accepting browsers support?
Code: Select all
// using jQuery */
$.get(dayfile,function(fdata){
Code: Select all
$.each(lines,function(n,elem){
var wd_data=elem.split(field_delimiter); /* declare wd_data for each row,
as number of items varies between rows, since newer builds of Cumulus create more fields than older builds */
var the_date=wd_data[0].split(date_delimiter); // first item is date in format something like dd/mm/yy
// include observations only if for selected day (the Cumulus date does not include century)
if (('20'+the_date[2]==past_year)&& (the_date[1]==(1+(past_month)) // USA implementations swap month
&& (the_date[0]==past_day_of_month) // with day of month; this is written for UK arrangement
)){
for(var i=0; i<wd_data.length; i++){
parameter_array[i,0]=label_items[i];
parameter_array[i,1]="--";
if ((wd_data[i])!==""){
parameter_array[i,1]=wd_data[i]; // insert observations
}; // end of numerical testing if
switch(i){ // edit these cases to match your build of Cumulus, order does not matter
case 1: $('#gust').prepend(parameter_array[i,1]); break;
case 3: $('#Tgust').append(parameter_array[i,1]); break;
case 4: $('#low_temp').prepend(parameter_array[i,1]); break;