X-Received: by 10.99.121.132 with SMTP id u126mr14883851pgc.1.1482711701651; Sun, 25 Dec 2016 16:21:41 -0800 (PST) X-Received: by 10.157.35.89 with SMTP id k25mr683387otd.11.1482711701608; Sun, 25 Dec 2016 16:21:41 -0800 (PST) Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!b123no3521933itb.0!news-out.google.com!u18ni5985ita.0!nntp.google.com!75no3518718ite.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.javascript Date: Sun, 25 Dec 2016 16:21:41 -0800 (PST) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=72.49.195.178; posting-account=WTFS-AoAAABsiGRzE4MmIarYuIMkGBCZ NNTP-Posting-Host: 72.49.195.178 References: <1rz8pc765tt5d$.1mqm96f9bs5jy$.dlg@40tude.net> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: Simply displaying JSON data for users: what is your preferred method? From: David Mark Injection-Date: Mon, 26 Dec 2016 00:21:41 +0000 Content-Type: text/plain; charset=UTF-8 Xref: csiph.com comp.lang.javascript:31960 On Sunday, December 25, 2016 at 6:41:05 PM UTC-5, $Bill wrote: > On 12-25-16 15:19, Stefan Ram wrote: > > JJ writes: > >> Just guessing, but I think a regular expression based converter would be > >> more efficient and faster than object based. i.e. JSON string to HTML string > >> then slap it all together using innerHTML, instead of JSON objects to HTML > >> element objects. > > > > I believe that it should be quit difficult to properly parse > > JSON source with regular expression. > > I wrote a JSON parser in Perl using RE's and parsing out tokens which I then used > to create a Perl hash duplicating the JSON object - not that difficult code-wise > (maybe 500-600 lines including blanks), but haven't really checked the efficiency > of it. How about the accuracy? In other words, I agree with Stefan Ram's assessment (though his post is oddly absent here on Google Groups).