Hello everyone!

Hello all, This is my first post here. I am currently working on a dynamic scripts version of my website. I have to say this is my first javascripts using json

Message 1 of 2
, Dec 19, 2006

0 Attachment

Hello all,
This is my first post here. I am currently working on a dynamic scripts
version of my website. I have to say this is my first javascripts using
json format for the website that I attempt to create. I only familiar
with php page only. I used php class to convert the xml data to json
object on fly at the server and send it to client browser.

My question that I have is: What is the proper way to escape the
special charaters for json data to conform with javascripts character
rule either at client side or server side, I would prefer server side
since I like the best experience for visitor. I have sometime ran into
a couple error where javascript won't
be able to parse a json data from the server and generate the error due
to some data string contain invalid character which javascript won't
like.

I would appreciate any suggestion.

Sincerely,
KN

shalini israni

I faced a similar problem....but i am using Java... http://www.json.org/javadoc/org/json/XML.html presents a class which is a part of a downloadable API which

Message 2 of 2
, Jan 1, 2007

0 Attachment

I faced a similar problem....but i am using Java...http://www.json.org/javadoc/org/json/XML.html presents a class which is a
part of a downloadable API which has an escape function...
U can see if a similar thing is available for PHP...maybe someone faced a
similar problem... :)

On 12/19/06, canixs <canixs@...> wrote:
>
> Hello all,
> This is my first post here. I am currently working on a dynamic scripts
> version of my website. I have to say this is my first javascripts using
> json format for the website that I attempt to create. I only familiar
> with php page only. I used php class to convert the xml data to json
> object on fly at the server and send it to client browser.
>
> My question that I have is: What is the proper way to escape the
> special charaters for json data to conform with javascripts character
> rule either at client side or server side, I would prefer server side
> since I like the best experience for visitor. I have sometime ran into
> a couple error where javascript won't
> be able to parse a json data from the server and generate the error due
> to some data string contain invalid character which javascript won't
> like.
>
> I would appreciate any suggestion.
>
> Sincerely,
> KN
>
>
>

--

Shalini

[Non-text portions of this message have been removed]

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