View Full Version : Javascript in CSS

10-21-2003, 12:01 AM
Is it possible to include javascript in an external stylesheet? I've just encountered a bit of a problem with keeping .js files on our server.

10-21-2003, 12:02 AM
Not if you're not targetting nn4 uniquely, no.

10-21-2003, 12:05 AM
I am actually targeting IE 6.0 exclusivly so that's a no???

10-21-2003, 12:09 AM
What's the problem with .js files? It's common form them to be .js, but you could use .txt just as effectively.

There *may* be a MIME type issue, but I think it should work.

10-21-2003, 12:13 AM
Well - the company I work for is starting to use Red Dot CMS for there intranet maintanance. It is a decent tool however I have no edit access to the templetes provided. They blocked out the ability for me to input code all together with the exception of external stylesheets. It's a Sad day today. Basically I have no way of referencing the external file once I put it on the server the css file can be added via a form.

10-21-2003, 12:17 AM
Bummer. Not sure what to say.

I'm surprised that your company apparently wishes to handicap itself in this manner.

10-21-2003, 12:19 AM
LOL - My Sentiments Exactly!

10-21-2003, 02:19 AM
why not use a server side include that you could edit that contains the <script ..></script> tags?

10-21-2003, 07:59 AM
Hmm, I spoke too soon. You could use HTCs or css expressions...

10-21-2003, 09:28 AM
Ya, but those are both technologies for including scripting for only specific scenarios. Neither can be a replacement for linking script files.