CSS Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsWeb DesignCSS Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old January 1st, 2004, 05:48 PM
Fuente Fuente is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2002
Posts: 193 Fuente User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 6 h 37 m 37 sec
Reputation Power: 7
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.

Reply With Quote
  #2  
Old January 1st, 2004, 06:06 PM
Fuente Fuente is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2002
Posts: 193 Fuente User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 6 h 37 m 37 sec
Reputation Power: 7
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.

Reply With Quote
  #3  
Old January 1st, 2004, 08:41 PM
cliffhanger9's Avatar
cliffhanger9 cliffhanger9 is offline
fortin bra?
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Location: city of sin, state of the art
Posts: 416 cliffhanger9 Negative: is most likely a SPAMMER and a traitor to the cause. 
Time spent in forums: 18 h 22 m 19 sec
Reputation Power: 0
Send a message via ICQ to cliffhanger9 Send a message via AIM to cliffhanger9 Send a message via MSN to cliffhanger9 Send a message via Yahoo to cliffhanger9
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-

Reply With Quote
  #4  
Old January 2nd, 2004, 06:00 AM
Akh's Avatar
Akh Akh is offline
|<.+#f@#+.&.|
Dev Shed Frequenter (2500 - 2999 posts)
 
Join Date: Mar 2002
Location: norway
Posts: 2,685 Akh User rank is Colonel (50000 - 60000 Reputation Level)Akh User rank is Colonel (50000 - 60000 Reputation Level)Akh User rank is Colonel (50000 - 60000 Reputation Level)Akh User rank is Colonel (50000 - 60000 Reputation Level)Akh User rank is Colonel (50000 - 60000 Reputation Level)Akh User rank is Colonel (50000 - 60000 Reputation Level)Akh User rank is Colonel (50000 - 60000 Reputation Level)Akh User rank is Colonel (50000 - 60000 Reputation Level)Akh User rank is Colonel (50000 - 60000 Reputation Level)Akh User rank is Colonel (50000 - 60000 Reputation Level)Akh User rank is Colonel (50000 - 60000 Reputation Level)Akh User rank is Colonel (50000 - 60000 Reputation Level) 
Time spent in forums: 4 Weeks 6 h 17 m 10 sec
Reputation Power: 594
you ought to use
type="text/javascript" not language="javascript"


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

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignCSS Help > Using CSS to post a piece of code...


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway
Stay green...Green IT