PDA

View Full Version : Within a javascript get url command, how do I insert variables



3dron
November 21st, 2002, 05:20 AM
i have:

getURL("javascript:openNewWindow('http://www.test.com/add=1&name=itest_tem,'testwin','width=600,height=400,scr ollbars,location,resizable,status')
");

How would insert variables to change the add value? It doesnt seem to work with syntax like

getURL("javascript:openNewWindow('"http://www.test.com/add=" + addvalue +
"&name=test_item",'testwin','width=600,height=400,scrollbars,locati on,resizable,status')
");

Please help

sbeener
November 21st, 2002, 01:19 PM
i notice you have a double quote after test_item. shouldn't that be a single quote?

rest assured, you can pass variables like this from flash.

3dron
November 21st, 2002, 02:12 PM
That double quote is what closes my quote for:
"&name=test_item"

So I am trying to add the following together:

"http://www.test.com/add="

+ addvalue +

"&name=test_item"

What am I doing wrong?

Ron

h88
November 21st, 2002, 04:17 PM
That should work:


add1=12
getURL("javascript:open('http://www.waever.com?add=" + add1 + "&name=itest_tem','testwin','width=600,height=400,sc rollbars,location,resizable,status');");

yours,
h88