Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / HTML, CSS, Scripts / JavaScript / June 2007



Tip: Looking for answers? Try searching our database.

JSON parsing errors...[looks like thers some problem wid NEw line characters]

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
cool_buddy218@yahoo.com - 30 Jun 2007 22:35 GMT
Hi i'm having problems with my json scripts. When I retrieve data that
contains new lines it causes an error from firebug. I've used a couple
of replace like .replace("\n", "
"), .replace(/\n/g, "\\n") but it still didn't work. Please have a
feed back on this thanks!

-bryan
www.nachofoto.com
-Lost - 01 Jul 2007 00:59 GMT
> Hi i'm having problems with my json scripts. When I retrieve data that
> contains new lines it causes an error from firebug. I've used a couple
> of replace like .replace("\n", "
> "), .replace(/\n/g, "\\n") but it still didn't work. Please have a
> feed back on this thanks!

You have your newlines escaped incorrectly.  I believe:

.replace(/\\n/mg, '\n')

...is what you want.

Signature

-Lost
Remove the extra words to reply by e-mail.  Don't e-mail me.  I am
kidding.  No I am not.

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.