Skip to search.

Breaking News Visit Yahoo! News for the latest.

×Close this window

json · JSON JavaScript Object Notation

The Yahoo! Groups Product Blog

Check it out!

Group Information

  • Members: 591
  • Category: Data Formats
  • Founded: Jul 19, 2005
  • Language: English
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Hear how Yahoo! Groups has changed the lives of others. Take me there.

Messages

Advanced
Messages Help
Messages 387 - 416 of 1954   Oldest  |  < Older  |  Newer >  |  Newest
Messages: Show Message Summaries Sort by Date ^  
#387 From: Stefan Gössner <stefan@...>
Date: Thu Jun 1, 2006 4:39 pm
Subject: Converting Between XML and JSON ... article
stefangoessner
Send Email Send Email
 
Hello list,

I just want to let you know, that I published an article over at xml.com

http://www.xml.com/pub/a/2006/05/31/converting-between-xml-and-json.html

discussing a "pragmatic approach" to convert XML documents to a JSON
structure and ideally back again to XML without loss of information.

#388 From: json@yahoogroups.com
Date: Fri Jun 2, 2006 8:21 am
Subject: Poll results for json
json@yahoogroups.com
Send Email Send Email
 
The following json poll is now closed.  Here are the
final results:


POLL QUESTION: Which of the following data communication methods / techniques do
you use ?

CHOICES AND RESULTS
- JSON . [Object notation / serialization]., 0 votes, 0.00%
- XML., 0 votes, 0.00%
- Other object serialization., 0 votes, 0.00%
- None of the above - just interested., 0 votes, 0.00%
- JSON & XML, 3 votes, 100.00%



For more information about this group, please visit
http://groups.yahoo.com/group/json

For help with Yahoo! Groups, please visit
http://help.yahoo.com/help/us/groups/

#389 From: "Kevin Smith" <yahoogroups@...>
Date: Sat Jun 3, 2006 4:37 pm
Subject: Licensing [was: Re: Introduction Date and Function objects...]
kevinbsmith
Send Email Send Email
 
--- In json@yahoogroups.com, "Martin Cooper" wrote:
>
> On 5/26/06, Greg Patnude <gpatnude@...> wrote:
> >
> > Speaking of the "Good NOT Evil" license -- is anyone interested in
> > formalizing that ? like the myriad licensing already available --
> > GPL, or LGPL, or BSD Licenses...  we could call it the "GNOTE"
> > license....
>
>
> No, no, no! There are already dozens and dozens of open source
> licenses. There is absolutely no good reason to invent another one.
> Do you have any idea how much legal crap creating a new license
> creates for any company or other organisation that actually wants
> to use the associated software?

I completely agree. We were unable to use the GNOTE-licensed code in
either our GPL application, or in our other app that's currently
closed-source. Fortunately, we found a json implementation under a
simpler license, so we didn't have to re-invent it from scratch.

Personally, my big problem with the GNOTE license is: WHO decides what
is evil? Some folks thing gays are evil, while others think that
anti-gay behavior is evil. Some folks think Bin Laden is evil, but
I'm pretty sure he thinks his enemies are the evil ones. Worse...what
is "evil" can change over time, so I might be allowed to use the
software today, but next year my use might be considered evil by the
license holder.

It's a great idea, but just doesn't work in practice. Basically, it
will either discourage people from using the software, or will
encourage people to ignore or violate the license, whether
intentionally, or due to a disagreement over what is evil. Pretty much
anyone who takes licenses seriously will not be able to use GNOTE
software.

> I'd suggest the Apache License 2.0, which pretty much says you can
> do whatever you want with the software as long as you keep the
> original license in place.

Except that Apache License 2.0 code (arguably) can't be linked with
GPL software, which is unfortunate. For widest compatibility with
other licenses, I prefer the MIT-style license, which is even more
liberal. The LGPL also tends to work well with proprietary and Free
software.

Kevin

#390 From: Michal Migurski <mike-jsonphp@...>
Date: Sat Jun 3, 2006 7:03 pm
Subject: Re: Re: Introduction Date and Function objects to the standard [DATE PARSER]
michal_migurski
Send Email Send Email
 
> var dt = new Date("mm-dd-yy hh:mm:ss.ms");
>
>
> Since 99.999% of the dates / times I display in the UI come from the
> RDBMS -- this also made a lot of sense at the time....

Except for time zones.

>  RE: Unix date / time -- not everyone is into Unix... many people
> appear to be using PHP, Perl, and ASP... Personally -- if it were
> 100% Unix / C / Java / ANSI SQL types -- I would be a happy camper...
> but... we gotta provide support for the greatest common
> denominator... not the lowest common denominator...

As another poster commented, unix epoch is a great transmission
format thanks to its explicit treatment of time zones. Every language
I deal with in my work uses it (PHP, Python, ECMA-, Action-, and
JavaScript in milliseconds), and I find it vastly preferable when
moving data between web servers, DB servers, and client browsers that
are in unknown locations. The Atom spec does something similar, by
requiring dates to be expressed in UTC.

I'm generally opposed to the inclusion of dates and functions into
javascript, though. Python has four ways to describe dates, and PHP
limits what can be done with functions as data. No sense in taking a
simple, beautiful spec and complicating it just to satisfy a few edge
cases.

-mike.

----------------------------------------------------------------
michal migurski- contact info and pgp key:
sf/ca            http://mike.teczno.com/contact.html

#391 From: "Douglas Crockford" <douglas@...>
Date: Sun Jun 4, 2006 3:15 am
Subject: java/org.json.JSONString
douglascrock...
Send Email Send Email
 
I have added a JSONString interface. A class implementing it can
customize the JSON serialization of its instances.

http://www.json.org/java/index.html

#392 From: Mark Miller <markm@...>
Date: Sun Jun 4, 2006 4:41 am
Subject: Re: java/org.json.JSONString
capsecure
Send Email Send Email
 
Douglas Crockford wrote:
> I have added a JSONString interface. A class implementing it can
> customize the JSON serialization of its instances.
>
> http://www.json.org/java/index.html

On that page:
> If toJSONString throws any exception, or returns a non-string result, then
> the string value will be obtained the default way.

This seems like a dangerous masking of errors. If these conditions occur,
I would think the error should propagate, and the serialization to JSON should
fail. What am I missing?

--
Text by me above is hereby placed in the public domain

      Cheers,
      --MarkM

#393 From: "Douglas Crockford" <douglas@...>
Date: Sun Jun 4, 2006 12:43 pm
Subject: Re: java/org.json.JSONString
douglascrock...
Send Email Send Email
 
> > I have added a JSONString interface. A class implementing it can
> > customize the JSON serialization of its instances.
> >
> > http://www.json.org/java/index.html
>
> On that page:
> > If toJSONString throws any exception, or returns a non-string
result, then
> > the string value will be obtained the default way.
>
> This seems like a dangerous masking of errors. If these conditions
occur,
> I would think the error should propagate, and the serialization to
JSON should

You are right. It should throw a JSONException instead.

#394 From: "Mert Sakarya" <mertsakarya@...>
Date: Sun Jun 4, 2006 8:38 pm
Subject: RE: Re: JSDL (Javascript Service Definition Language)
mertsakarya
Send Email Send Email
 
I've finally had the time to check DOJO and JSDL and examining it since Friday.I
think I'll be able to use my server-side application (JSDL definition) with
DOJO.

It's good to know the people are thinking the same way, all over the world. I
thought, that this was something that I've found, but hey, someone has already
thought about it, and coded it on the web, while I was eating pizza ;). Even the
extension was the same. So I think I'll use DOJO as my client-side library,
instead of creating one from scratch.

I know this is not the place to talk about it, but has anyone been using DOJO on
real-time web project in this group? How does it perform? Any recommendations?

Mert Sakarya


To: json@...: mfncooper@...: Tue, 23 May 2006 09:14:10
-0700Subject: Re: [json] JSDL (Javascript Service Definition Language)You might
want to look at the Dojo toolkit. It already has a JSDLimplementation that it
uses along with its JsonService class for JSON-basedremote calls.--Martin
CooperOn 5/23/06, Mert Sakarya <mertsakarya@...> wrote:>> Lately I've
been coding with Javascript and JSON a lot. I'am using> XHConn.js (downloadable
from http://xkr.us/code/javascript/XHConn/)> as XmlHttpRequest object which is
quite small and efficient.>> I've noticed that it might be a good practice to
move or copy the> business/application layer to the client side (basically some
HTML> file). I've modified XHConn (XmlHttpRequest) a little, to use client->
side caching, work both synchronously and asynchronously and return> JSON
objects only (currently it is using eval function for> performance). The thing,
I like about using "eval" is, you can> create function properties.>> Assume that
you have a service that works just like a web service,> but this one talks only
JSON and works on Web pages over HTTP> (narrowed down the platform). JSON
objects are results of our> WebMethods which are callable through
XmlHttpRequests. If we can> group these methods in a service in a logical way,
we> get "Javascript Services". So we need something like WSDL to combine> these
methods. They should contain the definitions of the methods> (the body of the
method is a XmlHttpRequest to the server),> parameter validation and some very
light error checking (eg. if a> parameter can be null or the max length of
parameter etc.). I call> this concept JSDL (Javascript Service Definition
Language). The good> thing is, JSDL is itself written with Javascript and
actually can be> a JSON object (if we are allowed to add functions to JSON
standard).> In Javascript Services we can define functions like below;>>
function GetCustomer(custId) {>    if(!custId) throw "CUSTID null";>    return
(new XHConn()).connect("URL", "GET", "Parameters", null);> }>> or async
version;>> function GetCustomerAsync(custId, asyncCallback) {>    if(!custId)
throw "CUSTID null";>    (new XHConn()).connect("URL", "GET", "Parameters",
asyncCallback);> }>> Now assume that we combine these method definitions in a
JSON Object;>> Service.jsdl file>
------------------------------------------------------------------> {>  
"GetCustomer" : function(custId) {>      if(!custId) throw "CUSTID null";>     
return (new XHConn()).connect("URL", "GET", "Parameters", null);>   }>>  
"GetCustomerAsync" : function(custId, asyncCallback) {>      if(!custId) throw
"CUSTID null";>      (new XHConn()).connect("URL", "GET", "Parameters",>
asyncCallback);>   }> }>> As long as "Service.jsdl" file is a JSON object, it
can be> downloaded with XmlHttpRequest and be named as a service.>>
//Synchronous version;> try {>   var service = (new
XHConn()).connect("Service.jsdl", "GET", "",> null);>   var customer =
service.GetCustomer("CustId");> } catch(e) {>   alert(e);> }>> //Asynchronous
version;> try> {>   //probably we need to load the service synchronously>   var
service = (new XHConn()).connect("Service.jsdl", "GET", "", );>   var customer;>
service.GetCustomerAsync("CustId",>     function(jsonObj) {>       customer =
jsonObj;>     }>   );> }> catch(e)> {>   alert(e);> }>> All you need is to
figure out a way to generate JSDL files on the> server-side just like WSDL files
are generated may be something> like, attribute based programming on .Net.>>
I've got a working copy of this idea in a zip file, but i think> attachments are
not allowed here. Wait till I can upload it to the> internet or I can gladly
mail it individually.>> I've created a server-side solution for this(Javascript
Sevices and> JSDL), but it is another long story (may be I'll post it on some>
other mail) and covers a lot of other issues (eg. using MSMQ, RSS> generation,
Logging, Caching etc). JSDL is only a small part of it.> It is called
MS.Services and can be downloded from gotdotnet.com.>> Best regards,> Mert
Sakarya>>>>>>>>> Yahoo! Groups Links>>>>>>>[Non-text portions of this message
have been removed]
SPONSORED LINKS



Programming languages
Format
Computer security

Computer training
Large format
Cover letter formats


YAHOO! GROUPS LINKS

  Visit your group "json" on the web.
  To unsubscribe from this group, send an email to:
json-unsubscribe@yahoogroups.com
  Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.



_________________________________________________________________
It’s the future of Hotmail: Try Windows Live Mail beta
http://www2.imagine-msn.com/minisites/mail/Default.aspx?locale=en-us

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

#395 From: "q7joey" <joey@...>
Date: Tue Jun 6, 2006 3:38 am
Subject: Re: new c++ binding
q7joey
Send Email Send Email
 
well, it has been a while now and i've seen a fair number of
downloads, but so far i've gotten no feedback.  i see a few
possibilities.

1. my code is so perfect that nothing needs to be said.
2. the code is so horrible that people are spontaneously combusting
when they look at it.
3. the code has become sentient and has taken over anybody's machine
that has downloaded it and it has also disabled email so that no one
will catch on to its evil plans.
4. the nsa?

does anyone have feedback for me (public or private) about the c++
binding?  does it do everything a json binding should?  does it do it
in a way that makes sense?  how much more documentation does it need?
did it compile ok for you?

hoping to hear something...

#396 From: Lindsay <lindsay@...>
Date: Tue Jun 6, 2006 3:48 am
Subject: Re: Re: new c++ binding
softlog_lindsay
Send Email Send Email
 
q7joey wrote:
> well, it has been a while now and i've seen a fair number of
> downloads, but so far i've gotten no feedback.  i see a few
> possibilities.
>
> 1. my code is so perfect that nothing needs to be said.
> 2. the code is so horrible that people are spontaneously combusting
> when they look at it.
> 3. the code has become sentient and has taken over anybody's machine
> that has downloaded it and it has also disabled email so that no one
> will catch on to its evil plans.
> 4. the nsa?
>


You forgot option 5 - no ones is developing json enabled c++ apps :(



--
Lindsay

#397 From: Joe Pruett <joey@...>
Date: Tue Jun 6, 2006 3:50 am
Subject: Re: Re: new c++ binding
q7joey
Send Email Send Email
 
> You forgot option 5 - no ones is developing json enabled c++ apps :(

if i had't seen any downloads, that would make sense.  but i've seen more
than 20 brave souls grabbing the code.

#398 From: Lindsay <lindsay@...>
Date: Tue Jun 6, 2006 3:52 am
Subject: Re: Re: new c++ binding
softlog_lindsay
Send Email Send Email
 
Joe Pruett wrote:
>> You forgot option 5 - no ones is developing json enabled c++ apps :(
>>
>
> if i had't seen any downloads, that would make sense.  but i've seen more
> than 20 brave souls grabbing the code.
>

Ah - well then yes -  they should be feeding back


--
Lindsay



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

#399 From: "Joel Lucsy" <jjlucsy@...>
Date: Tue Jun 6, 2006 10:16 am
Subject: Re: Re: new c++ binding
jjlucsy
Send Email Send Email
 
I looked at your code, but couldn't see any advantage over the existing
project at http://sourceforge.net/projects/jsoncpp/
In fact, I found your code harder to read, less concise, and disliked your
choice of function/class names. Sorry.

--
Joel Lucsy
"The dinosaurs became extinct because they didn't have a space program." --
Larry Niven


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

#400 From: Joe Pruett <joey@...>
Date: Tue Jun 6, 2006 2:14 pm
Subject: Re: Re: new c++ binding
q7joey
Send Email Send Email
 
i wasn't aware of that project.  the json web site only pointed to the
zoolib code, which was a huge system that just happened to include json.
i'll take a look at it.  i certainly don't want to reinvent things with no
appreciable benefit.

#401 From: Will Coleda <will@...>
Date: Tue Jun 6, 2006 12:26 pm
Subject: Re: Re: new c++ binding
will_coleda
Send Email Send Email
 
On Jun 5, 2006, at 11:38 PM, q7joey wrote:

> well, it has been a while now and i've seen a fair number of
> downloads, but so far i've gotten no feedback. i see a few
> possibilities.

<SNIP>

http://en.wikipedia.org/wiki/Warnock%27s_Dilemma


--
Will "Coke" Coleda
will@...

#402 From: "Jan-Klaas Kollhof" <keyjaque@...>
Date: Tue Jun 6, 2006 4:14 pm
Subject: JSON-RPC metting June 19th, London
keyjaque
Send Email Send Email
 
Sorry for cross posting, I do feel it is related to JSON and not too OT.

Atif(you might know him from postings here) and I(JSON-RPC author) are
planning a meeting to talk about JSON-RPC on June 19th at around
6:00pm in central London.
If enough people sign up I will be booking a venue.
The plan is to meet up and talk about the next version of the specs,
have a couple pints or so and then later go for some food.
This should be a good mix of technical discussions and some
socializing for anyone interested in JSON-RPC.

If you are interested please use the json-rpc forum (
http://groups.yahoo.com/group/json-rpc ) to sign up or drop me a mail
so I know how many people to expect.

Jan

#403 From: kalyanasundaram S <kalyan_acm@...>
Date: Wed Jun 7, 2006 4:38 am
Subject: json || xml or json && xml
kalyan_acm
Send Email Send Email
 
Hello ppl,
i am new to this place. I am wondering how good is this?
I am browsing the old message to know about more on json.
already xml is well formed and it is used by almost everybody.

then how this json is better than the xml. Or it is just rebel for xml?

where all it is being used?
can anybody say why json is needed?

thanks,
   -"kalyan"


---------------------------------
   Yahoo! India Answers: Share what you know. Learn something new Click here
  Send free SMS to your Friends on Mobile from your Yahoo! Messenger Download now

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

#404 From: "Martin Cooper" <mfncooper@...>
Date: Wed Jun 7, 2006 5:01 am
Subject: Re: Licensing [was: Re: Introduction Date and Function objects...]
mfncooper
Send Email Send Email
 
On 6/3/06, Kevin Smith <yahoogroups@...> wrote:
>
> --- In json@yahoogroups.com, "Martin Cooper" wrote:


<snip/>

> I'd suggest the Apache License 2.0, which pretty much says you can
> > do whatever you want with the software as long as you keep the
> > original license in place.
>
> Except that Apache License 2.0 code (arguably) can't be linked with
> GPL software, which is unfortunate.


No, that's not the case (and there is no "arguably" ;), at least from an ASF
perspective.

There is a policy in place at the Apache Software Foundation (ASF) that
states that ASF projects cannot have required dependencies on, or bundle,
libraries licensed under the GPL or certain other licenses. What that means
is that whenever you download ASF software, you can be absolutely sure that
there are no "tricks up our sleeve" and you do not suddenly find yourself
using additional software, with incompatible licenses, that you may not have
expected.

That is _completely_ different from what you, as a user of ASF software,
choose to do with it. If you want to build an application that includes ASF
and GPL software, that is absolutely fine with the ASF.

For widest compatibility with
> other licenses, I prefer the MIT-style license, which is even more
> liberal. The LGPL also tends to work well with proprietary and Free
> software.


I'd agree that the MIT license is very flexible, but I'd suggest caution
with the LGPL in a business environment. But this is getting way off-topic
for this list...

--
Martin Cooper


Kevin
>
>
>
>
>
>
>
>
> Yahoo! Groups Links
>
>
>
>
>
>
>
>


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

#405 From: "Martin Cooper" <mfncooper@...>
Date: Wed Jun 7, 2006 6:17 am
Subject: Re: Re: JSDL (Javascript Service Definition Language)
mfncooper
Send Email Send Email
 
On 6/4/06, Mert Sakarya <mertsakarya@...> wrote:
>
> I've finally had the time to check DOJO and JSDL and examining it since
> Friday.I think I'll be able to use my server-side application (JSDL
> definition) with DOJO.
>
> It's good to know the people are thinking the same way, all over the
> world. I thought, that this was something that I've found, but hey, someone
> has already thought about it, and coded it on the web, while I was eating
> pizza ;). Even the extension was the same. So I think I'll use DOJO as my
> client-side library, instead of creating one from scratch.
>
> I know this is not the place to talk about it, but has anyone been using
> DOJO on real-time web project in this group? How does it perform? Any
> recommendations?


You're right, this is not the place to talk about Dojo. You should check out
the Dojo mailing lists, and the archives of those lists. There are many,
many hundreds of Dojo users on the list, so you will get lots of feedback if
you ask the right questions.

That said, as for "real-time", it somewhat depends on how you define that
term. Do you mean highly interactive applications, or do you specifically
mean Comet applications? Two commercial examples that might be of interest
to you are http://www.jotlive.com/ and http://www.renkoo.com/. Both are
built on Dojo.

At my company, we are using Dojo in current product development, but not for
real-time purposes (since we don't have any real-time requirements at this
time). You'd have a hard time persuading me to use anything else.

--
Martin Cooper


Mert Sakarya
>


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

#406 From: Philip Tellis <philip.tellis@...>
Date: Wed Jun 7, 2006 7:22 am
Subject: Re: json || xml or json && xml
philiptellis
Send Email Send Email
 
Sometime Today, kS cobbled together some glyphs to say:

> i am new to this place. I am wondering how good is this?
> I am browsing the old message to know about more on json.
> already xml is well formed and it is used by almost everybody.
>
> then how this json is better than the xml. Or it is just rebel for xml?

perhaps you should read up here: http://json.org/ and here:
http://www.json.org/xml.html first

Philip

--
"Stercus, stercus, stercus, moriturus sum."
(Interesting Times)

#407 From: Ashwin Prabhu <aprabhu1@...>
Date: Mon Jun 12, 2006 10:39 pm
Subject: JSON text not parsing on FireFox
ashp_says_hi
Send Email Send Email
 
Hi,

My JSON text looks as below:

myJSONtext  = {user: {errorFirstName:"", errorLastName:"",
errorEmail:"The email address you entered is not valid." } };

But when i try to fetch the values it gives an error as
invalidLabel.. not sure why this is happening?
Value is fetched as myJSONtext.user.errorFirstName.

Also i tried creating an array as in the example on http://
www.json.org/js.html

But still it gives myJSONtext.user has no properties.

Any hint what am i doing wrong.

- Ashwin

#408 From: "Martin Cooper" <mfncooper@...>
Date: Mon Jun 12, 2006 11:40 pm
Subject: Re: JSON text not parsing on FireFox
mfncooper
Send Email Send Email
 
On 6/12/06, Ashwin Prabhu <aprabhu1@...> wrote:
>
> Hi,
>
> My JSON text looks as below:
>
> myJSONtext  = {user: {errorFirstName:"", errorLastName:"",
> errorEmail:"The email address you entered is not valid." } };
>
> But when i try to fetch the values it gives an error as
> invalidLabel.. not sure why this is happening?


It works fine for me in Firebug. You didn't provide any surrounding code,
but are you sure myJSONtext is still in scope when you're trying to access
it?

--
Martin Cooper


Value is fetched as myJSONtext.user.errorFirstName.
>
> Also i tried creating an array as in the example on http://
> www.json.org/js.html
>
> But still it gives myJSONtext.user has no properties.
>
> Any hint what am i doing wrong.
>
> - Ashwin
>
>
>
>
>
> Yahoo! Groups Links
>
>
>
>
>
>
>
>


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

#409 From: henrik hjelte <henrik@...>
Date: Tue Jun 13, 2006 4:31 pm
Subject: Re: JSON text not parsing on FireFox
jagarenbrape...
Send Email Send Email
 
This is javascript code, not JSON. Keys should have surrounding quotes
in JSON.

{"user": {"errorFirstName":"", "errorLastName::"", "errorEmail":"The
email address you entered is not valid." } }

/Henrik Hjelte

On mån, 2006-06-12 at 22:39 +0000, Ashwin Prabhu wrote:
> Hi,
>
> My JSON text looks as below:
>
> myJSONtext = {user: {errorFirstName:"", errorLastName:"",
> errorEmail:"The email address you entered is not valid." } };
>
> But when i try to fetch the values it gives an error as
> invalidLabel.. not sure why this is happening?
> Value is fetched as myJSONtext.user.errorFirstName.
>
> Also i tried creating an array as in the example on http://
> www.json.org/js.html
>
> But still it gives myJSONtext.user has no properties.
>
> Any hint what am i doing wrong.
>
> - Ashwin
>
>
>
>
>

#410 From: Ashwin Prabhu <aprabhu1@...>
Date: Tue Jun 13, 2006 6:53 pm
Subject: Re: JSON text not parsing on FireFox
ashp_says_hi
Send Email Send Email
 
Hi Henrik and Martin,

Thanks very much for your response.
Without quotes its working for me.
With quotes FireFox is throwing an error as 'invalidLabel', when the
'eval' method is called.

Things are working now :)

- Ashwin


On Jun 13, 2006, at 9:31 AM, henrik hjelte wrote:

> This is javascript code, not JSON. Keys should have surrounding quotes
> in JSON.
>
> {"user": {"errorFirstName":"", "errorLastName::"", "errorEmail":"The
> email address you entered is not valid." } }
>
> /Henrik Hjelte
>
> On mån, 2006-06-12 at 22:39 +0000, Ashwin Prabhu wrote:
>> Hi,
>>
>> My JSON text looks as below:
>>
>> myJSONtext = {user: {errorFirstName:"", errorLastName:"",
>> errorEmail:"The email address you entered is not valid." } };
>>
>> But when i try to fetch the values it gives an error as
>> invalidLabel.. not sure why this is happening?
>> Value is fetched as myJSONtext.user.errorFirstName.
>>
>> Also i tried creating an array as in the example on http://
>> www.json.org/js.html
>>
>> But still it gives myJSONtext.user has no properties.
>>
>> Any hint what am i doing wrong.
>>
>> - Ashwin
>>
>>
>>
>>
>>
>
>
>
> ------------------------ Yahoo! Groups Sponsor --------------------
> ~-->
> Home is just a click away.  Make Yahoo! your home page now.
> http://us.click.yahoo.com/DHchtC/3FxNAA/yQLSAA/1U_rlB/TM
> --------------------------------------------------------------------
> ~->
>
>
> Yahoo! Groups Links
>
>
>
>
>
>
>

#411 From: "Douglas Crockford" <douglas@...>
Date: Wed Jun 14, 2006 4:02 am
Subject: Re: JSON text not parsing on FireFox
douglascrock...
Send Email Send Email
 
> With quotes FireFox is throwing an error as 'invalidLabel', when the
> 'eval' method is called.

Why are you using eval?

#412 From: Ashwin Prabhu <aprabhu1@...>
Date: Thu Jun 15, 2006 6:40 pm
Subject: Re: Re: JSON text not parsing on FireFox
ashp_says_hi
Send Email Send Email
 
Hi Doug,

My understanding of JSON was that you need to form a Text in such way
that,  when we create a JSON object using 'eval', then we can
traverse its properties using aJSONObject.attributeName.
So instead of returning XML and parsing it (which i have done before
in javascript ),  i am returning this text and then converting it
into a JSON object.
Am i thinking wrong! Please correct me.

Thanks.

- Ashwin

On Jun 13, 2006, at 9:02 PM, Douglas Crockford wrote:

>> With quotes FireFox is throwing an error as 'invalidLabel', when the
>> 'eval' method is called.
>
> Why are you using eval?
>
>
>
>
>
> ------------------------ Yahoo! Groups Sponsor --------------------
> ~-->
> You can search right from your browser? It's easy and it's free.
> See how.
> http://us.click.yahoo.com/_7bhrC/NGxNAA/yQLSAA/1U_rlB/TM
> --------------------------------------------------------------------
> ~->
>
>
> Yahoo! Groups Links
>
>
>
>
>
>
>

#413 From: "Matthew Morley" <WickedLogic@...>
Date: Thu Jun 15, 2006 7:05 pm
Subject: Re: Re: JSON text not parsing on FireFox
mpcmtechnolo...
Send Email Send Email
 
Perhaps he is asking why you aren't using:

http://json.org/json.js
-----------------------------------------------------
         string.parseJSON()

             This method parses a JSON text to produce an object or
             array. It will return false if there is an error.
--
Matt (MPCM)

#414 From: Michal Migurski <mike-jsonphp@...>
Date: Thu Jun 15, 2006 7:00 pm
Subject: Re: Re: JSON text not parsing on FireFox
michal_migurski
Send Email Send Email
 
> My understanding of JSON was that you need to form a Text in such way
> that, when we create a JSON object using 'eval', then we can
> traverse its properties using aJSONObject.attributeName.
> So instead of returning XML and parsing it (which i have done before
> in javascript ), i am returning this text and then converting it
> into a JSON object.
> Am i thinking wrong! Please correct me.
It would be helpful to have some more context; the first snippet you
sent was just plain old Javascript, and didn't show how you're using
eval().

-mike.

------------------------------------------------------
michal migurski- contact info, blog, and pgp key:
sf/ca            http://mike.teczno.com/contact.html

#415 From: "Todd Kingham" <toddkingham@...>
Date: Thu Jun 15, 2006 7:14 pm
Subject: Re: Re: JSON text not parsing on FireFox
toddkingham
Send Email Send Email
 
Ashwin,

It sounds like either your eval() statement is incorrect or your JSON string
is malformatted.

Below is a simple example of some JSON written in JavaScript that I know
will work in Firefox.

var JSONstr = '{keyOne:"Alpha",keyTwo:"Omega"}';
var JSONvar = eval('('+JSONstr+')');
alert(JSONvar.keyOne);

This should work if you replace the JSONstr variable I'm setting here with a
JSON string dynamically built on the server and passed in.

HTH,
-Todd



On 6/15/06, Ashwin Prabhu <aprabhu1@...> wrote:
>
>    Hi Doug,
>
> My understanding of JSON was that you need to form a Text in such way
> that, when we create a JSON object using 'eval', then we can
> traverse its properties using aJSONObject.attributeName.
> So instead of returning XML and parsing it (which i have done before
> in javascript ), i am returning this text and then converting it
> into a JSON object.
> Am i thinking wrong! Please correct me.
>
> Thanks.
>
> - Ashwin
>
> On Jun 13, 2006, at 9:02 PM, Douglas Crockford wrote:
>
> >> With quotes FireFox is throwing an error as 'invalidLabel', when the
> >> 'eval' method is called.
> >
> > Why are you using eval?
> >
> >
> >
> >
> >
> > ------------------------ Yahoo! Groups Sponsor --------------------
> > ~-->
> > You can search right from your browser? It's easy and it's free.
> > See how.
> > http://us.click.yahoo.com/_7bhrC/NGxNAA/yQLSAA/1U_rlB/TM
> > ----------------------------------------------------------
> > ~->
> >
> >
> > Yahoo! Groups Links
> >
> >
> >
> >
> >
> >
> >
>
>
>


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

#416 From: "keelypavan" <keelypavan@...>
Date: Thu Jun 15, 2006 7:08 pm
Subject: Re: JSON text not parsing on FireFox
keelypavan
Send Email Send Email
 
Ashwin,

This confusion came up because in the sample code you provided:

> myJSONtext = {user: {errorFirstName:"", errorLastName:"",
> errorEmail:"The email address you entered is not valid." } };

You directly have Javascript statement for object and there was no
need for 'eval'ing it. That was Doug's point.

Pavan Keely

--- In json@yahoogroups.com, "Matthew Morley" <WickedLogic@...> wrote:
>
> Perhaps he is asking why you aren't using:
>
> http://json.org/json.js
> -----------------------------------------------------
>         string.parseJSON()
>
>             This method parses a JSON text to produce an object or
>             array. It will return false if there is an error.
> --
> Matt (MPCM)
>

Messages 387 - 416 of 1954   Oldest  |  < Older  |  Newer >  |  Newest
Add to My Yahoo!      XML What's This?

Copyright © 2010 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines NEW - Help