Path: csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!feeder.erje.net!newsfeed.straub-nv.de!uucp.gnuu.de!newsfeed.arcor.de!newsspool2.arcor-online.net!news.arcor.de.POSTED!not-for-mail Content-Type: text/plain; charset="ISO-8859-1" Message-ID: <1933274.nKmheAe9J7@PointedEars.de> From: Thomas 'PointedEars' Lahn Reply-To: Thomas 'PointedEars' Lahn Organization: PointedEars Software (PES) Date: Tue, 08 Nov 2011 21:43:22 +0100 User-Agent: KNode/4.4.11 Content-Transfer-Encoding: 7Bit Subject: Re: Code not working Newsgroups: comp.lang.javascript References: <11359e10-c765-4434-ae51-703c99b5d60f@x36g2000prb.googlegroups.com> <4eb5cd88$0$28441$a8266bb1@newsreader.readnews.com> Followup-To: comp.lang.javascript MIME-Version: 1.0 Lines: 29 NNTP-Posting-Date: 08 Nov 2011 21:43:22 CET NNTP-Posting-Host: 1d29e0b3.newsspool3.arcor-online.net X-Trace: DXC=>3>YWk6f=I]5TOT9_N5i Mclaren Fan wrote: >> Not working the above code should change background color like a toogler >> pleasehelp > > 1) the content attribute of the script element needs to be a recognised > script language. I've never heard of javscript! The `script' element does not have a `content' attribute. It has a `type' attribute, for example. > How to find the body element: > > var body = document.getElementsByTagName("body")[0]; Because var body = document.body; is too simple, too compatible or too efficient? PointedEars -- var bugRiddenCrashPronePieceOfJunk = ( navigator.userAgent.indexOf('MSIE 5') != -1 && navigator.userAgent.indexOf('Mac') != -1 ) // Plone, register_function.js:16