Forum Moderators: open
I have a quick question. I am trying to use a variable "height" but my function statement is ignoring it.
Based on the browser type I want to be able to change the height in the function below. Everything is working and I have different values going into the variable height but I am unable to get the function to use the variable properly.
If anyone can show me the correct Javascript I should use, it would be greatly appreciated.
Thanks for your help
Lou Sniderman
-------------------------------------------------------
javascript function:
function openpopup4(){
var popurl="konica_case_study1.htm"
winpops=window.open(popurl,"","width=600,height,screenX=50,screenY=50,top=50,left=50")
}
I am trying to get the "height" to work. If I were to put height=500 that would work but then I would be unable to change it.
Thanks
Since the word "height" is already part of the variables string, you're better off using something different to avoid confusion. The following example will take the value of a variable called hhh and use that value as the height. Also notice the winpops(hhh) which sets up the function to receive a variable and plug it in the correst spot.
winpops(hhh)=window.open(popurl,"","width=600,height=' + hhh + ',screenX=50,screenY=50,top=50,left=50")
}