Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #8363

Re: David Mark's Javascript Daily - Volume #3 - Tip #6 - How to Get and Set HTML

From Andreas Bergmaier <andber93@web.de>
Newsgroups comp.lang.javascript
Subject Re: David Mark's Javascript Daily - Volume #3 - Tip #6 - How to Get and Set HTML
Date 2011-11-16 02:29 +0100
Organization albasani.net
Message-ID <j9v3l8$472$1@news.albasani.net> (permalink)
References <b8aaaf65-2095-4145-8992-651aae0e9a69@p9g2000vbb.googlegroups.com> <j9ulej$141$1@news.albasani.net> <2724045.nNXnhXx0nj@PointedEars.de>

Show all headers | View raw


Thomas 'PointedEars' Lahn schrieb:
> Andreas Bergmaier wrote:
>
>> Only because the native html parser is faster than the javascript
>> interpreter?
>
> There is no "javascript"

I know I should spell it "JavaScript", but when I'm writing English my 
shift key often stucks - sorry. You don't have to remind me of that, but 
thanks.

> and you have a common misconception of how code
> written in an ECMAScript implementation is being executed by a Web browser.

I hope not, but isn't "interpreting code" a short form for "interpreting 
syntax, building a (implementation specific) native structure, and 
execute it when requested"?

>> I could understand the use of innerHTML when it's for large static
>> elements delivered as plain text per ajax - where the server can
>> serialize the structure into HTML.
>
> What you are writing may read sophisticated and even meaningful to the
> uninitiated, but it actually makes no sense at all.  I strongly suggest you
> familiarize yourself with the workings of Web server and browser – and
> perhaps English – before making further (English-language) statements on
> this topic.  For example, the Web *server* does not (need to) serialize
> anything if you use XHR to request HTML markup in the response message.

No, you understood me right. A server has same structured data, for 
example in a database, which should be displayed on the client's screen. 
So either the server generates HTML markup, or it sends the data as some 
other type - e.g. json -, which could decrease the file size 
significantly. In the first case the script engine would use innerHTML, 
in the second it could either build the table with dom methods or 
serialize the data to a markup string and use innerHTML again. So which 
of the three ways is faster?

  Bergi

Back to comp.lang.javascript | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

David Mark's Javascript Daily - Volume #3 - Tip #6 - How to Get and Set HTML David Mark <dmark.cinsoft@gmail.com> - 2011-11-15 11:47 -0800
  Re: David Mark's Javascript Daily - Volume #3 - Tip #6 - How to Get and Set HTML Andreas Bergmaier <andber93@web.de> - 2011-11-15 22:26 +0100
    Re: David Mark's Javascript Daily - Volume #3 - Tip #6 - How to Get and Set HTML Gregor Kofler <usenet@gregorkofler.com> - 2011-11-15 22:57 +0100
    Re: David Mark's Javascript Daily - Volume #3 - Tip #6 - How to Get and Set HTML "J.R." <groups_jr-1@yahoo.com.br> - 2011-11-15 21:16 -0200
    Re: David Mark's Javascript Daily - Volume #3 - Tip #6 - How to Get and Set HTML Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2011-11-16 01:11 +0100
      Re: David Mark's Javascript Daily - Volume #3 - Tip #6 - How to Get and Set HTML Andreas Bergmaier <andber93@web.de> - 2011-11-16 02:29 +0100
  Re: David Mark's Javascript Daily - Volume #3 - Tip #6 - How to Get and Set HTML Dr J R Stockton <reply1146@merlyn.demon.co.uk> - 2011-11-16 18:51 +0000

csiph-web