...

View Full Version : Open Window With & in the link!



newbiefied
08-25-2002, 12:57 AM
Hi All,

onclick="javascript:window.open('large_pic.asp?large_image=http://www.geocities.com/somat/stared.jps?middle=yes&upper=no','','width=400,height=338,toolbar,scrollbars,resizable,')"

Tried using & (not sure if &
& will come out properly!)

Need it to be onclick as theres several on one page etc..

Any ideas??

joh6nn
08-25-2002, 01:07 AM
try escaping it:

\&

zuckera
08-27-2002, 04:43 PM
Hi,

your problem is that & is used by the SERVER to separate different parameters. Therefore when a page url looks like this :
http://www.server.com/test.asp?param1=8& param2=a&b
you actually have 3 (!) parameters to the server : param1 (which equals 8), param2 (which equals a), and b (which equals nothing but is defined). This is not what we want.
To avoid this problem you need to escape the & so that it will be a parameter for the jps call (http://www.geocities.com/somat/stared.jps) , not the asp call.
using %26 should do it, you can escape the whole url instead (use : escape("http://www.geocities.com/somat/stared.jps?middle=yes& upper=no") ) which will do the translation for you.

hth,

Amir



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum