...

View Full Version : using variables in javascript



davehaz
06-01-2006, 04:34 PM
howdy,
I am attempting to write a script that determines the screen resolution but am having problems using the variables I have created.


var screenw = (window.screen.width)
var screenh = (window.screen.height)

window.open(a, 'determined','toolbar=yes,scrollbars=yes,resizable=yes,location=yes,directories=yes,menubar=yes,stat us=yes,width=screenw,height=screenh');


when I use this I get a very small window opened. What am I doing wrong here?


thanks.

vwphillips
06-01-2006, 04:56 PM
window.open(a, 'determined','toolbar=yes,scrollbars=yes,resizable=yes,location=yes,directories=yes,menubar=yes,stat us=yes,width='+screenw+',height='+screenh);


must be used as variables not just as part of the string

davehaz
06-01-2006, 06:07 PM
that did the trick thanks alot.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum