W3C home > Mailing lists > Public > www-style@w3.org > April 2000

Re: Style Tag, and JavaScript Clash

From: Clover Andrew <aclover@1VALUE.com>
Date: Mon, 3 Apr 2000 10:35:56 +0200
Message-ID: <5F78AA062F6AD311A59000508B4AAF6D092AF2@pcs02>
To: "'rpaul'" <rpaul@suffolk.lib.ny.us>
Cc: "'www-style@w3.org'" <www-style@w3.org>
rpaul <rpaul@suffolk.lib.ny.us> wrote:

> My question may be far too simplistic for this group. If so, 
> and anyone knows of another list, please let me know.

The canonical place for CSS queries is the newsgroup
comp.infosystems.www.authoring.stylesheets. However, it -
and the JavaScript newsgroup comp.lang.javascript which
your question also pertains to - are normally high-traffic,
clogged with questions normally considerably more simplistic
than yours.

(Unless it has improved; I am currently without newsfeed.)

Personally I'd quite like to see a newsgroup dedicated to
the crossover of stylesheets and scripting, the endless
problems with current browser implementations, and
writing scripts to work with DOM, IE4 and Netscape 4,
without having to wade through c.l.j.'s "How can I hide my
scripts so people can't read them" posts.
alt.dhtml.recovery, perhaps. Or something.

Anyway, answering the question here because it's quite a
common problem:

> in Netscape [,] Any JavaScript commands that I position 
> directly with the style tag - or that are within a table
> that I position with the style tag - become disabled.

This sounds like another consequence of the Netscape
"every positioned object is a separate document" object
model, which normally cannot be avoided. Solution: move
all your scripts into one <script> element at the top
of your document, like where your <style> definitions
should be. You will also have to re-write the scripts
so that they access document.layers['...'].document.x
instead of just document.x. Of course you'll have to
detect (via document.layers) whether Netscape is running
first, and if not use your normal code. And Netscape
will probably still just crash anyway.

Welcome to DHTMhelL, my friend. ah haha hahahaha.
Ooh sorry, don't know what came over me there.

-- 
Andrew Clover
Technical Support
1VALUE.com AG
Received on Monday, 3 April 2000 04:38:52 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:54:04 GMT