Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    Apr 2005
    Posts
    388
    Thanks
    0
    Thanked 0 Times in 0 Posts

    using variables in javascript

    howdy,
    I am attempting to write a script that determines the screen resolution but am having problems using the variables I have created.
    Code:
    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,status=yes,width=screenw,height=screenh');
    when I use this I get a very small window opened. What am I doing wrong here?


    thanks.

  • #2
    Senior Coder
    Join Date
    Mar 2005
    Location
    Portsmouth UK
    Posts
    4,517
    Thanks
    3
    Thanked 506 Times in 493 Posts
    Code:
    window.open(a, 'determined','toolbar=yes,scrollbars=yes,resizable=yes,location=yes,directories=yes,menubar=yes,status=yes,width='+screenw+',height='+screenh);
    must be used as variables not just as part of the string
    Vic

    God Loves You and will never love you less.

    http://www.vicsjavascripts.org/Home.htm

    If my post has been useful please donate to http://www.operationsmile.org.uk/

  • #3
    Regular Coder
    Join Date
    Apr 2005
    Posts
    388
    Thanks
    0
    Thanked 0 Times in 0 Posts
    that did the trick thanks alot.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •