Ruby on Rails Tuesday, January 29, 2019



On Tuesday, January 29, 2019 at 4:21:43 AM UTC-5, Colin Law wrote:
On Tue, 29 Jan 2019 at 03:20, fugee ohu <fuge...@gmail.com> wrote:
> ...
> Can you give me an idea how to extract it

Are you seriously asking, after the years that you have been using
Ruby, that you don't know how to extract a particular section from a
string?  Apart from anything else, since I haven't got access to the
full string (nor do I want it), I have no idea what the details
surrounding the JSON section are so can't tell you how to do it.

Colin

It looks like this:
 /**/jQuery18308525223902976695_1548819829968({"success":true,"code":0,"results":[{"productId":32755997022,"sellerId":201591356,"oriMinPrice":"US $275.00 ... });

JSON.parse and cxt.eval both return errors even if I remove everything up to the first { and then chomp the trailing )

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/9783f3a7-4739-4de9-8a44-a4c4900d0c8c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment