Link to home
Start Free TrialLog in
Avatar of Brad Bansner
Brad Bansner

asked on

Javascript syntax for opening a new window based on image rotator selection

I use links like this to open enlarged images in a new window, it works very well:

<A HREF="javascript:openWin('_enlarge.asp?file=ph_ex3_console','800','600')">

The 800 and 600 let me specify the size of the window. However, I need to call this same function from a Javascript which lets the user rotate through images in a slideshow, and click the one they are on to enlarge. Here is what it looks like:

openWin('_enlarge.asp?file=' + document['currentimg'].src);

It basically works, except I cannot find the correct syntax to insert the 800 and 600. I tried this but it does not work:

openWin('_enlarge.asp?file=' + document['currentimg'].src + '800,600');

I guess its just a syntax problem, I don't know how to specify those parameters with the single quotes.

Thank you.
Avatar of Ashish Patel
Ashish Patel
Flag of India image

use like this and check.
<A HREF="javascript:window.open('_enlarge.asp?file=ph_ex3_console', 'winname', 'width=800, height=600');">
ASKER CERTIFIED SOLUTION
Avatar of toddbehnke
toddbehnke

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Brad Bansner
Brad Bansner

ASKER

Thank you, I got it to work now.