|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Using CSS to post a piece of code...
I have a large piece of (javascript) code that is posted a few times on the page that I'm creating, so I was wondering if there was a way to put all of this into the CSS file, so that I could simply post it with:
Code:
<div id="code"> Would this be possible? Thanks. ![]() |
|
#2
|
|||
|
|||
|
Or would it make more sense to use a .js file and if so, how would I go about assigning a word to it and posting the code in the correct place?
Thanks. ![]() |
|
#3
|
||||
|
||||
|
i dont belive you can put javascript into css sheets...
you can however put them in an external .js file and reference that like... Code:
<script src=externalFileName.js language=JavaScript></script> as for placing it where you want it like a css style it kinda depends on the script how you have it set up... post some code and i m sure someone could tell ya how you would do that.. but yea i think an external js would be the best answer.. good lucky and rock on!! ![]()
__________________
"I hate quotations." -ralph waldo emerson- |
|
#4
|
||||
|
||||
|
you ought to use
type="text/javascript" not language="javascript" <script src="externalFileName.js" type="text/javascript"></script> |
![]() |
| Viewing: Dev Shed Forums > Web Design > CSS Help > Using CSS to post a piece of code... |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|