Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.javascript > #15665
| Message-ID | <1802819.gFTYypYLGV@PointedEars.de> (permalink) |
|---|---|
| From | Thomas 'PointedEars' Lahn <PointedEars@web.de> |
| Organization | PointedEars Software (PES) |
| Date | 2012-09-03 21:45 +0200 |
| Subject | Re: String Processing in JavaScript |
| Newsgroups | comp.lang.javascript |
| References | <rgf248la5ap1dusauc9ek39jasff47mht4@4ax.com> <k22pe2$cmk$1@news.albasani.net> |
| Followup-To | comp.lang.javascript |
Followups directed to: comp.lang.javascript
Stefan Weiss wrote:
> On 2012-09-01 00:56, Gene Wirchenko wrote:
>> I will be passing back long result strings to my Web pages. These
>> strings have to be parsed into error codes and form field contents.
>> What I am working with looks like
>> <fieldname>:<value length>:<value>\n
>> The value is encodeURIComponent()ed.
>
> From your other posts, it appears that you're in control of both backend
> and client code. If that's the case, you may want to consider one of the
> many standardized data transfer formats.
> JSON would be the obvious choice, as it's trivially easy to use for a
> JavaScript client, and it's well supported in every major server-side
> language. Others possible choices include XML (also well supported by
> JS) […]
In contrast to built-in JSON support from ECMAScript (ECMA-262) Edition 5
forward [0], ECMAScript and its conforming implementations have no native
support for XML.
However, many more recent host environments provide features to support XML
with ECMAScript binding that are standardized or in the standardization
process, thus host objects such as DOMParser [1] and XMLSerializer [2], and
of course XMLHttpRequest (which has a responseXML property to implement
refer to an object implementing the Document interface if the Content-Type
fits) [3].
There have been implementations of ECMAScript for XML (E4X, ECMA-357) in
Mozilla, thus Mozilla-based browsers, but development of that and support of
E4X has been discontinued there, unfortunately. Firefox 10 and later do not
support E4X syntax and objects in ES5 strict mode. E4X support will likely
be disabled by default per Firefox 17. [4] E4X support today can still be
found in the older Rhino 1.7 implementation, for example. The ECMAScript
Support Matrix [5] already contains one test case for the for-each statement
of E4X. As time permits, there are going to be more E4X-related test cases
there.
PointedEars
___________
[0] <http://ecma-international.org/ecma-262/5.1/#sec-5.1.5>
[1] <https://developer.mozilla.org/en-
US/docs/DOM/DOMParser?redirectlocale=en-US&redirectslug=DOMParser>
[2] <https://developer.mozilla.org/en-US/docs/XMLSerializer>
[3] <https://developer.mozilla.org/en-
US/docs/DOM/XMLHttpRequest?redirectlocale=en-US&redirectslug=XMLHttpRequest>
[4] <http://en.wikipedia.org/wiki/E4X> pp.
[5] <http://PointedEars.de/es-matrix/>
--
var bugRiddenCrashPronePieceOfJunk = (
navigator.userAgent.indexOf('MSIE 5') != -1
&& navigator.userAgent.indexOf('Mac') != -1
) // Plone, register_function.js:16
Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
String Processing in JavaScript Gene Wirchenko <genew@ocis.net> - 2012-08-31 15:56 -0700
Re: String Processing in JavaScript Mike Winter <usenet@michael-winter.me.invalid> - 2012-09-01 02:30 +0100
Re: String Processing in JavaScript Gene Wirchenko <genew@ocis.net> - 2012-09-02 17:56 -0700
Re: String Processing in JavaScript Jim T. <x@y.z> - 2012-08-31 22:30 -0400
Re: String Processing in JavaScript "Mel Smith" <med_cutout_syntel@aol.com> - 2012-08-31 21:47 -0600
Re: String Processing in JavaScript "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2012-09-01 08:51 +0000
Re: String Processing in JavaScript "Mel Smith" <med_cutout_syntel@aol.com> - 2012-09-01 08:38 -0600
Re: String Processing in JavaScript Gene Wirchenko <genew@ocis.net> - 2012-09-02 18:04 -0700
Re: String Processing in JavaScript "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2012-09-03 16:30 +0000
Re: String Processing in JavaScript Mike Winter <usenet@michael-winter.me.invalid> - 2012-09-03 21:23 +0100
Re: String Processing in JavaScript Gene Wirchenko <genew@ocis.net> - 2012-09-03 14:26 -0700
Re: String Processing in JavaScript Stefan Weiss <krewecherl@gmail.com> - 2012-09-03 19:29 +0200
Re: String Processing in JavaScript Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-09-03 21:45 +0200
Re: String Processing in JavaScript Gene Wirchenko <genew@ocis.net> - 2012-09-03 14:27 -0700
Re: String Processing in JavaScript Stefan Weiss <krewecherl@gmail.com> - 2012-09-04 00:48 +0200
Re: String Processing in JavaScript Gene Wirchenko <genew@ocis.net> - 2012-09-03 17:20 -0700
Re: String Processing in JavaScript Tim Streater <timstreater@greenbee.net> - 2012-09-04 10:06 +0100
Re: String Processing in JavaScript Ross McKay <au.org.zeta.at.rosko@invalid.invalid> - 2012-09-04 20:02 +1000
Re: String Processing in JavaScript Gene Wirchenko <genew@ocis.net> - 2012-09-04 08:47 -0700
csiph-web