Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Java and CSS

0 views
Skip to first unread message

Jim

unread,
Jun 16, 2001, 5:44:46 PM6/16/01
to
I have a little java script which prevents visitors from right clicking on
their mouse and saving pictures to their system.

I would like to include this in my CSS (cascasing style sheet) so that I do
not have to put the java script into each page.

I am new to CSS but found the to be very useful and makes the pages easier
to manage. Unfortuanately I can not figure out how to put a java script in
CSS.

Is it possible?

Thanks

Jose Jeria

unread,
Jun 17, 2001, 8:26:07 AM6/17/01
to
You can not have javascript - code in the CSS.
What you could do is to have a javascript-file that you include in
every page.

Example:
<SCRIPT LANGUAGE="Javascript" SRC="myGlobalScript.js"></SCRIPT>

/Jose Jeria

"Jim" <j...@jkirkpatrick.com> wrote in message
news:9ggk7v$rj7$1...@sshuraaa-i-1.production.compuserve.com...

Steve Fulton

unread,
Jun 17, 2001, 8:32:54 AM6/17/01
to
You can't include JavaScript in a CSS. You CAN use the src attribute of the
script tag to include common code in many pages.

<script type="text/javascript" src="yourcode.js"></script>

=-=-=
Steve
-=-=-

"Jim" <j...@jkirkpatrick.com> wrote in message
news:9ggk7v$rj7$1...@sshuraaa-i-1.production.compuserve.com...

0 new messages