[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [cgiapp] RFC: CGI::Application::Plugin::AJAX v0.02


On 03/07/05, Ron Savage <suppressed> wrote:
> On Sun, 3 Jul 2005 01:02:49 +0100, Paul Campbell wrote:
> 
> Hi Paul
> 
> > # Once the server replies, this is what we do with the answer
> > callback => "
> > ajax_elid('result').innerHTML = '= ' + result;
> > ajax_elid('symbol').innerHTML = '*'; ", } );
> 
> Which browsers support innerHTML?

Went looking to find out...

So innerHTML is a MS proprietary extension that isn't part of the DOM
standard that happens to be supported by Firefox.  Presumably because
it is used by so many sites.  Thus testing on FF and IE didn't show it
as being a problem.

So a DOM-way of doing the same would be:

ajax_elid('result').childNodes[0].nodeValue = '= ' + result;
ajax_elid('symbol').childNodes[0].nodeValue = '*';

However, this fails if the node is empty.  ('Has no properties').  A
helper/wrapper to check for that and add a childNode would be useful.

I appreciate your comment, Ron.  Thanks.

I'll refrain from working out a complete wrapper here, but will put
one into the distribution.

-- 
Paul Campbell
<suppressed>
http://kemitix.net/blog/cossmass/pbem/

---------------------------------------------------------------------
Web Archive:  http://www.mail-archive.com/suppressed/
              http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: suppressed
For additional commands, e-mail: suppressed


Mail converted by mhonarc 2.6.15
This archive provided courtesy of JSW4.NET, Internet Hosting Services for Small Business.