473,381 Members | 1,630 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,381 software developers and data experts.

json-php on slashdot

In my journal anyway:

"JSON: Javascript Unusable by the Client"

http://slashdot.org/~scriptify/journal/103074

Jul 17 '05 #1
1 1783
"George Jempty" <sc*******@yahoo.com> writes:
In my journal anyway:

"JSON: Javascript Unusable by the Client"

http://slashdot.org/~scriptify/journal/103074


I must admit, I fail to see the point of your journal entry. It appears
to try to point out problems with JSON, but which problems? And are
they JSON problems or strawmen? (I'm leaning towards the latter).
quote: "This same sample data file specified as the src attribute of a
script tag results in a page throwing a Javascript error"

Well, what did you expect?

JSON is a *value* description language. It is a subset of ECMAScript's
literal notation, which is *expression* syntax. When you try loading
and evaluating it as a statement, it fails.

If you fetch the text using XMLHttpRequest and evaluates it using
"eval", then it works perfectly (and if you are targeting a browser
only, it's a much better format to send your data in than, e.g., XML).

You have a language for expression values. You want these values to
be available to your code, so you must have some way of getting the
text and parsing it.

*One* such way is to put the *JSON* text into a *Javascript*
assignment and load the assignment into a script tag on a web page.
That does not make the assignment part of the JSON value, nor
does it need to be.

But, looking at the *first* answer in the PHP-JSON thread linked to,
all this has already been said.
<URL:http://groups.yahoo.com/group/json-php/message/9>

Ah, I now see that you are the "scriptify" of that conversation.
I'll just chip in and say that Michal Migurski is *absolutely right*.

From what you have written so far, I am not able to see a need that
cannot be solved using PHP and the JSON library. If you can express
your need more clearly, I am certain we can find a way to fulfill it.

(On the other hand, the "sample data for a C# parser" does have an
error. It should not end with a semicolon).
/L
--
Lasse Reichstein Nielsen - lr*@hotpop.com
DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleDOM.html>
'Faith without judgement merely degrades the spirit divine.'
Jul 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

16
by: G Matthew J | last post by:
http://htmatters.net/htm/1/2005/07/evaling-JSON.cfm This is more or less in response to Mr Crockford's admonition a few months ago, "fork if you must". Ironically, although in that usenet post...
20
by: Luke Matuszewski | last post by:
Welcome As suggested i looked into JSON project and was amazed but... What about cyclical data structures - anybody was faced it in some project ? Is there any satisactional recomendation... ...
8
by: Douglas Crockford | last post by:
There is a new version of JSON.parse in JavaScript. It is vastly faster and smaller than the previous version. It uses a single call to eval to do the conversion, guarded by a single regexp test to...
2
by: Kevin Newman | last post by:
Hello, I noticed that the JavaScript library for JSON posted on json.org (http://www.json.org/json.js) is modifying Object.prototype (adding a method - toJSONString). I thought this was...
3
by: Adam | last post by:
I'm trying to retrieve some values from a json object, but instead it's giving me the property name. For example: var json = { "glossary": { "title": "example glossary" } }; console.log(json);...
2
by: ChrisO | last post by:
I've been pretty infatuated with JSON for some time now since "discovering" it a while back. (It's been there all along in JavaScript, but it was just never "noticed" or used by most until...
5
by: Marc | last post by:
I'm aware that there are significant differences between VBScript objects and JScript objects but that doesn't mean something like the following should give me such troubles? <%@...
23
by: dhtmlkitchen | last post by:
JSON We all know what it is. In ECMAScript 4, there's a JSON proposal: Object.prototype.toJSONString String.prototype.parseJSON The current proposal, String.prototype.parseJSON, returns...
9
by: Jon Paal [MSMD] | last post by:
using json like ( {"Records": , "RecordCount":"1" } ) and jquery like: $.ajax({ .... success: function(json, status) {
6
by: Lasse Reichstein Nielsen | last post by:
Max <adsl@tiscali.itwrites: Not really. It shows that a particularly nave implementation of a conversion from XML to JSON doesn't work well. What if the conversion of <e> some
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.