I am working throug a VFP ISAPI COM that responds to the browser with javascript.
I hacked around an issue today useing the js "var" to assign varibles (in js) when the browser received the page.
I [think] I made a correlation. the "var" pre-cast seems only to be effective in functions other than "init" functions designated by an "onload".
Color me java green. Here is a snip (forgive the delimeters code is from VFP COM(:
[function Radio_Click(theCourseId){]+CR+;
[var theUrl="HTTP://Somehost/scripts/foxISAPI.dll/MyCOM.myClass.myMethod?pwd="thePwd]+CR+;
[alert("]+theUrl+[")]
THe above returns the url. But, when I do it inside an init called by a js "onload", I get a "THEURL" (note all upper case) Not found. In fact, the var assigment in an onload will not recognize any var (or so it seems) assignmens. I have not tried with "new string" casts.
I solved it by assembling the "var" in VFP above before the script response. Is "var" restricted in a js onload call?
I must confess that I also spent several hours chasing down one problem when all I needed to do was assure I had the case of the variable names agree.
Imagination is more important than knowledge