[Javascript] detect js
Paul Novitski
paul at novitskisoftware.com
Fri Jan 28 18:15:28 CST 2005
Matt,
I agree with you completely about isolating javascript and CSS in external
files.
But did I miss something? I didn't recall Ron suggesting using inline
javascript, only the use of document.write. I haven't used document.write
in a while, but I don't recall any restriction on using it from an external
file. In case I've forgotten something important, please elucidate.
Regards,
Paul
At 11:20 AM 1/28/2005, Matt Warden wrote:
>On Fri, 28 Jan 2005 02:15:36 -0500, Ron Koster <ron at psymon.com> wrote:
> > Um, why not just use document.write to write out the HTML code for the form
> > to log in? If they don't have javascript enabled, they won't see any code,
> > of course -- and, naturally, only people with javascript enabled will be
> > logging in (which is what was wanted).
> >
> > Seems so obvious... is there something I'm missing?
>
>Yes.
>
>See rule #1:
>http://www.onlinetools.org/articles/unobtrusivejavascript/chapter1.html
>
>In my opinion, Javascript interspersed with markup is even worse than
>inline CSS.
>
>Here is an example of hiding/displaying elements while separating JS,
>CSS, and XHTML (JS is in the document only for simplicity -- it could
>just as easily be moved to an external file -- same with the CSS):
>http://mwarden.f2o.org/sandbox/collapsible_elements.htm
>
>
>
>--
>Matt Warden
>Miami University
>Oxford, OH, USA
>http://mattwarden.com
More information about the Javascript
mailing list