Click to See Complete Forum and Search --> : "invalid argument" error on window.open(...)


JackGross
01-08-2003, 07:36 AM
I am getting an error alert ("invalid argument") when clicking a hyperlink image that opens a pop-up. Script Debugger points to a line of the form
w=window.open(arg1,arg2,arg3);

The window is an iframe (a report quadrant in a dash-board display). The report has four such links, three of which open popups. The name of the popup window is constant for a given quadrant. All three pop-ups exhibit the behavior.

Two of those popups present dialogs for refreshing the report shown in the quadrant. It is only after such a refresh that the behavior occurs.

I suspect it is connected with opening a window with the same name as the one, now closed, that last refreshed the qudrant.

JackGross
01-08-2003, 10:27 AM
Thanks, it was parameter content, as you (and the message) suggested. :o

I compared view-source from the first and second round. The app (it's a WedFocus reporting application) was failing to pass thru ("keep alive") a value for a variable (QUAD, used in composing the window name for the next round of pop-ups) on the refresh. Selected JavaScript content from the refreshed report is appended below.

The problem was specificaclly in the window-name parameter value. (Should be "pop4ivr02b", as in the first round; wound up as "pop!IBI.AMP.QUAD;ivr02b", on which open() choked.)

NOTE: I haven't been able to get much mileage from the IE Script Debugger, beyond it's finding the offending line. Is there anything better, or a FAQ on its use for inspecting/modifying var content, etc.?

-- JG.

var TEST=0;
/// TEST=1;
/* these vars values are dynamic content, set by the WebFocus report server based on query-string parameters. */
var COLORCODE = "#006666" ;
var GDIMS = "3D" ;
var GTYPE = "STB" ;
var HAX = parseInt("434") ;
var HFEX = "ivr02b" ;
var MAXIMIZED = "N" ;
var QUAD = "!IBI.AMP.QUAD;"; /* should be "4" */
var VAX = parseInt("221") ;

var escColor = escape(COLORCODE);

/* <snip> */

function graphsel() {
var wName = "pop"+QUAD+HFEX;
var theleft = (((screen.width) / 2)-300);
var thetop = (((screen.height) /2)-140);
var features = "scrollbars=no,toolbar=no,width=685,height=392,resizable,top="
+ thetop + ",left=" + theleft ;

newwindow=window.open("/cag2/blank.htm",wName,features);
form=document.all.launchForm;
form.target = newwindow.name;
form.IBIF_ex .value ="ivrgsel" ;
form.COLORCODE.value = COLORCODE ;
form.GDIMS .value = GDIMS ;
form.GTYPE .value = GTYPE ;
form.HAX .value = HAX ;
form.HFEX .value = HFEX ;
form.MAXIMIZED.value = MAXIMIZED ;
form.QUAD .value = QUAD ;
form.VAX .value = VAX ;
form.submit();

newwindow.window.focus();
}

JackGross
01-08-2003, 07:38 PM
:cool: Thanks!