Google Mail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
javascript helper adding slashed to JSON object output
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  3 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Follow-up To:
Add Cc | Add Follow-up to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers that you hear
 
mlecho  
View profile   Translate to Translated (View Original)
 More options 7 Nov, 17:09
From: mlecho <saltlessbr...@gmail.com>
Date: Sat, 7 Nov 2009 09:09:38 -0800 (PST)
Local: Sat 7 Nov 2009 17:09
Subject: javascript helper adding slashed to JSON object output
hi, i am using the javascript helper to generate JSON feeds. It works
great, except for one thing...if a json property has  a value that is
an absolute url, cakephp wants to escape all the slashes...exampe:

{"flag_img":"http:\/\/www.website.com\/themes\/images\/country\/
countryimage.png"}

how can i get that url without escapes? I just need it as a straight
string.


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
mlecho  
View profile   Translate to Translated (View Original)
 More options 7 Nov, 17:18
From: mlecho <saltlessbr...@gmail.com>
Date: Sat, 7 Nov 2009 09:18:24 -0800 (PST)
Local: Sat 7 Nov 2009 17:18
Subject: Re: javascript helper adding slashed to JSON object output
ah- echo stripslashes($javascript->object($data));
seems to do the trick
unless there is a better way?

On Nov 7, 9:09 am, mlecho <saltlessbr...@gmail.com> wrote:


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
adaa  
View profile   Translate to Translated (View Original)
 More options 8 Nov, 05:59
From: adaa <adnan....@gmail.com>
Date: Sat, 7 Nov 2009 21:59:45 -0800 (PST)
Local: Sun 8 Nov 2009 05:59
Subject: Re: javascript helper adding slashed to JSON object output
this is how JSON works. You need to unescape() the string in the
javascript before using it. if you use jQuery it's automatically done.
If you unescape it from php you'll be in trouble from some browsers.

    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google