Loading ...
Sorry, an error occurred while loading the content.
 

urlEncode a string in Javascript

Expand Messages
  • Echo
    is there any way to take make this & that into this%20%26%20that? -Echo
    Message 1 of 3 , Oct 1, 2003
      is there any way to take make this & that into this%20%26%20that?

      -Echo
    • James Eberhardt
      ... You ll want to check some documentation around the following functions: encodeURI() decodeURI() encodeURIComponent() decodeURIComponent() This is not
      Message 2 of 3 , Oct 1, 2003
        >> is there any way to take make this & that into this%20%26%20that?

        You'll want to check some documentation around the following functions:
        encodeURI()
        decodeURI()
        encodeURIComponent()
        decodeURIComponent()

        This is not directly aimed at Echo, but some of the people on this list
        should learn to read some documentation before posting questions. Some
        of the questions on this list are so basic that a simple flip through
        even the briefest of documentation would find an answer. If you are
        serious about learning Javascript, or even have a passing fancy in
        learning it, I would HIGHLY recommend that everyone go out and buy the
        book: "Javascript: The Definitive Guide, 4th Edition", by O'Reilly
        Press.

        James
      • Chris Scott
        Hello Echo, ... encodeURIComponent() (& decodeURIComponent() if you want to change it back), should do what you re after. HTH, Chris
        Message 3 of 3 , Oct 2, 2003
          Hello Echo,

          > is there any way to take make this & that into this%20%26%20that?

          encodeURIComponent() (& decodeURIComponent() if you want to change it back),
          should do what you're after.

          HTH,

          Chris
        Your message has been successfully submitted and would be delivered to recipients shortly.