Passing variables in javascript works very similar to the PowerBuilder method.
When a window is opened, a variable is assigned to it. Using dot notation, a
variable within the window can be assigned a value. Note that the variable does
not have to be declared within the calling window; it is created
at runtime, just like all other javascript variables. Here is an example:
w_lookup = window.open("tttlu.html","w_tttlu",
"toolbar=0,menubar=0,location=0,status=0,height=470,width=630") ;
w_lookup.w_tttnew = parent; /* allow window to refer to this window */
w_lookup.asset_id = 12345; /* int value */
w_lookup.tnt_code = "NTRS"; /* char value */
These three variables can be accessed within the window w_lookup, as follows:
newvar = asset_id ;
w_tttnew.f_processcode(tnt_code);
Note how the calling window's function is called.
|
|