Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > Encode string in Ruby decode it in Javascript?

Reply
Thread Tools

Encode string in Ruby decode it in Javascript?

 
 
Linus Oleander
Guest
Posts: n/a
 
      07-15-2010
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/.

 
Reply With Quote
 
 
 
 
Michael Fellinger
Guest
Posts: n/a
 
      07-16-2010
[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/.

 
Reply With Quote
 
 
 
 
Linus Oleander
Guest
Posts: n/a
 
      07-16-2010
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/.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How encode & decode string to integer and back to string? sumit Java 0 03-10-2012 10:17 AM
decode a string to "Perl's internal form" without Encode module? Raymundo Perl Misc 4 02-28-2007 07:12 PM
How can I encode/decode clock signal and data? MNQ VHDL 2 05-18-2004 05:12 AM
Anyone know of an MP3 equalizer app, no encode/decode? fitwell Computer Support 2 09-22-2003 11:48 AM
java and unicode: is decode always revertible by encode Harald Kirsch Java 2 08-28-2003 12:48 PM



Advertisments