Encode string in Ruby decode it in Javascript?

Discussion in 'Ruby' started by Linus Oleander, Jul 16, 2010.

  1. As the title describe.
    I need to pass some data from the server side to the browser.
    But I cant figure out how to encode it on the server en decode using
    Javascript.

    Any ideas?
    --
    Posted via http://www.ruby-forum.com/.
     
    Linus Oleander, Jul 16, 2010
    #1
    1. Advertising

  2. [Note: parts of this message were removed to make it a legal post.]

    JSON

    On Jul 16, 2010 8:42 AM, "Linus Oleander" <> wrote:

    As the title describe.
    I need to pass some data from the server side to the browser.
    But I cant figure out how to encode it on the server en decode using
    Javascript.

    Any ideas?
    --
    Posted via http://www.ruby-forum.com/.
     
    Michael Fellinger, Jul 16, 2010
    #2
    1. Advertising

  3. Michael Fellinger wrote:
    > JSON
    >
    > On Jul 16, 2010 8:42 AM, "Linus Oleander" <>
    > wrote:
    >
    > As the title describe.
    > I need to pass some data from the server side to the browser.
    > But I cant figure out how to encode it on the server en decode using
    > Javascript.
    >
    > Any ideas?


    I'm already using JSON to pass data to the client.
    But as I wrote in my first post i need to decode a string on the server
    site and decode it in the client.

    I found a solution to the problem.

    The unescape(); method on the client (JS)
    And on the server I used URI::escape (Ruby)
    --
    Posted via http://www.ruby-forum.com/.
     
    Linus Oleander, Jul 16, 2010
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. MNQ
    Replies:
    2
    Views:
    687
    Eyck Jentzsch
    May 18, 2004
  2. Harald Kirsch
    Replies:
    2
    Views:
    2,171
    Harald Kirsch
    Aug 28, 2003
  3. Damir Hakimov

    base64.encode and decode not correct

    Damir Hakimov, Aug 16, 2005, in forum: Python
    Replies:
    1
    Views:
    361
  4. sumit
    Replies:
    0
    Views:
    391
    sumit
    Mar 10, 2012
  5. Raymundo
    Replies:
    4
    Views:
    213
    -berlin.de
    Feb 28, 2007
Loading...

Share This Page