Send a parameter with window.open

M

Magnus Blomberg

Hello!

I am very new to javascripts and wonder if there are any ways to send a
parameter from a javascript with window.open.

My java code is like:
<script language="JavaScript"> function openpic(picid) {

window.open("PicContainer.aspx","","width=450,height=400,left=180,top=10");
} </script>

As you see I have the picid as a parameter. Tried to add it as
PicContainer.aspx?ID=" & picid
but it didn't work.

Is it not possible to put an httpstring variable in the url this way? How
could I solve it?

Regards Magnus
 
H

Hermit Dave

for javascript you have to use + not &
<script language="JavaScript"> function openpic(picid) {

window.open("PicContainer.aspx?ID=" + picid
,"","width=450,height=400,left=180,top=10");
} </script>

--

Regards,

Hermit Dave
(http://hdave.blogspot.com)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top