I have a production webpage working fine for over a year now.
Recently, I wanted to upgrade to 1.4.2 in order to take advantage of the many new features.
It seems that the passing of
array variables weeks_selected and years_selected in the code below is not accepted in 1.4.2. When these were replaced with scalar variables for the sake of testing, 1.4.2 worked fine.
Of course, the application is based on sending any number of weeks within a year, or any number of years, and so an array must be passed.
As mentioned earlier, simply by reverting to 1.3.2, everything is fine.
While the 1.3.2 and 1.4.2 getJSON functions do differ, maybe something was changed or broken or fixed.
Hopefully the author of this module can take a look at it. Or shed some light as to what crazy thing I am doing.
As a workaround, I could simply concatenate my array elements into a string and pass them on. The hard part was finding where the problem is.
Thanks.
Sammy
abcParsing
Microsoft Debugger Output
nodeName: function( elem, name ) {
return elem.nodeName && elem.nodeName.toUpperCase() === name.toUpperCase();
},
// args is for internal usage only
each: function( object, callback, args ) {
var name, i = 0,
length = object.length, //line 552 is this one
isObj = length === undefined || jQuery.isFunction(object);
if ( args ) {
...
return object;
}
The getJSON Function is listed below. JSON was also validated by
www.jsonlint.com
The getJSON Function is listed below.
$.getJSON(php_program, // 1st arg to getJSON is the URI of the script
{
test_category:test_category,
test_selected:test_selected,
noise:noise_value,
ph_noise:ph_noise_value,
cal:cal_value,
ph_cal:ph_cal_value,
qt:qt_value,
weeks_selected:[weeks_selected],
years_selected:[years_selected],
analysis_option:analysis_option,
aborted_runs_option: aborted_runs_option,
week_definition:week_definition,
rf_database_option:rf_database_option
},
function(wom) {
$.each(wom,function(i,j) {
noise_array.push([j.wom,j.Noise]);
ph_noise_array.push([j.wom,j.PH_Noise]);
cal_array.push([j.wom,j.Cal]);
ph_cal_array.push([j.wom,j.PH_Cal]);
qt_array.push([j.wom,j.QT]);
var index=j.wom + "_Noise";
noise_totals_array[index]=j.ds0_total_cntr;
index=j.wom + "_PH_Noise";
ph_noise_totals_array[index]=j.ds1_total_cntr;
index=j.wom + "_Cal";
cal_totals_array[index]=j.ds2_total_cntr;
index=j.wom + "_PH_Cal";
ph_cal_totals_array[index]=j.ds3_total_cntr;
index=j.wom + "_QT";
qt_totals_array[index]=j.ds4_total_cntr;
});
JSON Code Output with 1.3.2(Nothing gets printed with 1.4.2). Produced Using PHP's jason_encode
[{"wom":16,"Noise":57,"ds0_total_cntr":100,"PH_Noise":71,"ds1_total_cntr":99,"Cal":86,"ds2_total_cntr":100,"PH_Cal":36,"ds3_total_cntr":99,"QT":85,"ds4_total_cntr":100},{"wom":17,"Noise":47,"ds0_total_cntr":100,"PH_Noise":56,"ds1_total_cntr":100,"Cal":84,"ds2_total_cntr":100,"PH_Cal":36,"ds3_total_cntr":100,"QT":87,"ds4_total_cntr":100}]