Some values being changes when passing through URL

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • sancha

    #1

    Some values being changes when passing through URL

    Hi,
    i am trying to pass values to a struts action using javascript. It
    works fine until the value has something like '+' or '&' sign in it.
    Is this a problem with javascript or these values cannot be passed in
    the URL ?

    takeExample.do? field='+field+' &Code='+code

    this is the url im making

    if code is 'trying + something else'
    i get 'trying something else' from the request.getPara meter

    if it is 'trying & something else'
    i get 'trying '


    Please Help
    Thnax in advance
  • McKirahan

    #2
    Re: Some values being changes when passing through URL

    "sancha" <chaudhuri.sand ip@gmail.com> wrote in message
    news:a9c6323b.0 501042036.3edd4 616@posting.goo gle.com...[color=blue]
    > Hi,
    > i am trying to pass values to a struts action using javascript. It
    > works fine until the value has something like '+' or '&' sign in it.
    > Is this a problem with javascript or these values cannot be passed in
    > the URL ?
    >
    > takeExample.do? field='+field+' &Code='+code
    >
    > this is the url im making
    >
    > if code is 'trying + something else'
    > i get 'trying something else' from the request.getPara meter
    >
    > if it is 'trying & something else'
    > i get 'trying '
    >
    >
    > Please Help
    > Thnax in advance[/color]

    Look into JavaScript's escape() and unescape():





    Comment

    • Michael Winter

      #3
      Re: Some values being changes when passing through URL

      On Wed, 05 Jan 2005 11:12:57 GMT, McKirahan <News@McKirahan .com> wrote:

      [snip]
      [color=blue]
      > Look into JavaScript's escape() and unescape():[/color]

      The escape and unescape functions are deprecated. They are also
      inappropriate when not applied to the entire URL (as in this case).

      See my post to the earlier incarnation of this thread.

      Mike

      --
      Michael Winter
      Replace ".invalid" with ".uk" to reply by e-mail.

      Comment

      Working...