Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Jun 2002
    Location
    Midlands, UK
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Angry Open Window With & in the link!

    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 &
    Code:
    &
    will come out properly!)

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

    Any ideas??

  • #2
    Senior Coder joh6nn's Avatar
    Join Date
    Jun 2002
    Location
    72 W. 48' 57" , 41 N. 32' 04"
    Posts
    1,887
    Thanks
    0
    Thanked 1 Time in 1 Post
    try escaping it:

    \&
    bluemood | devedge | devmo | MS Dev Library | WebMonkey | the Guide

    i am a loser geek, crazy with an evil streak,
    yes i do believe there is a violent thing inside of me.

  • #3
    New to the CF scene
    Join Date
    Aug 2002
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •