From 95d6555deb7e4bd104874dfed1a84fd67982de93 Mon Sep 17 00:00:00 2001 From: "jake%acutex.net" <> Date: Fri, 14 Sep 2001 03:04:40 +0000 Subject: Fix for bug 58436 - javascript strict warnings in query.cgi Patch by Christian Reis r= caillon@returnzero.com, jake@acutex.net --- query.cgi | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) (limited to 'query.cgi') diff --git a/query.cgi b/query.cgi index 9ba9ea689..978592549 100755 --- a/query.cgi +++ b/query.cgi @@ -396,7 +396,7 @@ $jscript .= << 'ENDSCRIPT'; function updateSelect( array, sel, target, sel_is_diff, single ) { - var i; + var i, comp; // if single, even if it's a diff (happens when you have nothing // selected and select one item alone), skip this. @@ -444,9 +444,9 @@ function fake_diff_array( a, b ) { var newsel = new Array(); // do a boring array diff to see who's new - for ( ia in a ) { + for ( var ia in a ) { var found = 0; - for ( ib in b ) { + for ( var ib in b ) { if ( a[ia] == b[ib] ) { found = 1; } @@ -469,6 +469,7 @@ function merge_arrays( a, b, b_is_select ) { var pos_a = 0; var pos_b = 0; var ret = new Array(); + var bitem, aitem; // iterate through both arrays and add the larger item to the return // list. remove dupes, too. Use toLowerCase to provide @@ -539,10 +540,10 @@ function merge_arrays( a, b, b_is_select ) { function selectProduct( f ) { - // this is to avoid events that occur before the form itself is - // ready. mozilla doesn't seem to trigger this, though. + // this is to avoid handling events that occur before the form + // itself is ready, which happens in buggy browsers. - if ( !f ) { + if ( ( !f ) || ( ! f.product ) ) { return; } @@ -572,15 +573,15 @@ function selectProduct( f ) { var is_diff = 0; var single; - // is nothing selected, pick all + // if nothing selected, pick all if ( f.product.selectedIndex == -1 ) { - for ( i=0 ; iGive me a clue about how to use this form.

"; print qq{ -

+ -- cgit v1.2.3-24-g4f1b