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


Groups > comp.lang.javascript > #21300

Re: Can't refer to innerHTML contents

Message-ID <1676242.YrdhhZhtd8@PointedEars.de> (permalink)
From Thomas 'PointedEars' Lahn <PointedEars@web.de>
Organization PointedEars Software (PES)
Date 2013-09-12 18:24 +0200
Subject Re: Can't refer to innerHTML contents
Newsgroups comp.lang.javascript
References <1189445998.370906.306330@r34g2000hsd.googlegroups.com> <c4fc8bad-5a37-4cb7-aa93-34dc849382b0@googlegroups.com>

Show all headers | View raw


Edmund Maruhn wrote:

> A bit old this thread

“A bit old” indeed – it is from 2007, so hardly relevant in 2013.  A lot has 
changed in the meantime.  Only Google Groups users would see it because 
Google Groups is (based on) a Usenet archive, and it is FUBAR on top of 
that.  Please either do not use it or tell Google to fix it.  TIA.

> […]
> Maybe this has been solved already by someone before my post here.

Maybe, during those 6 years.

> However, here is my solution:
> 
> function loadHTMLFragment(elementId, fragment)
> {
> if (document &&
> document.getElementById &&

This (type-converting a host object's method) will break in not that recent 
IE/MSHTMLs.

> document.getElementById(elementId) &&
> document.createElement &&

Same here.

> document.appendChild &&
> document.getElementsByTagName) {

And here.  Consider jsx.object.isHostMethod() and the like instead:

<http://PointedEars.de/wsvn/JSX/trunk/object.js>

Your code does not appear to solve a real problem, let alone the unreal 
problem the OP had 6 years(!) ago.

-- 
PointedEars

Twitter: @PointedEars2
Please do not Cc: me. / Bitte keine Kopien per E-Mail.

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


Thread

Re: Can't refer to innerHTML contents Edmund Maruhn <ema@outermedia.biz> - 2013-09-12 08:53 -0700
  Re: Can't refer to innerHTML contents Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-09-12 18:24 +0200
    Re: Can't refer to innerHTML contents "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2013-09-12 20:31 +0200

csiph-web