Win a copy of Modern JavaScript for the Impatient this week in the Server-Side JavaScript and NodeJS forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Using variables for JavaScript popup window parameters

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
Does anyone know the syntax for allowing variables to define the parameters of JS popup windows. For instance,
function win_popUp(url,win_width,win_height) {
pp_window = window.open
(url,'','width=win_width,height=win_height');
}

HTML call:
<a href="javascript:win_popUp('test.html',400,600)">
If this is a dumb question, please bear with me, as I'm new to the world of JavaScript.
Thanks,
Bill
 
Ranch Hand
Posts: 413
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
open(url,id,"width=" + win_width + ",height=" +win_height);
 
Bill Bail
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Yuriy.
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
look at this link:
http://www10.brinkster.com/A1ien51/scripts/PopUpWinGenV3.htm
 
Bill Bail
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Good link. Thanks Al!
 
Don't get me started about those stupid light bulbs.
    Bookmark Topic Watch Topic
  • New Topic