This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes Using css classes in external javascript file? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Using css classes in external javascript file?" Watch "Using css classes in external javascript file?" New topic
Author

Using css classes in external javascript file?

Justin Fox
Ranch Hand

Joined: Jan 24, 2006
Posts: 802
How would I use an external .css class in my external .js file?

Thanks,

Justin Fox


You down with OOP? Yeah you know me!
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60077
    
  65

Once a JavaScript file is loaded, there is no difference between whether the script was on-page or in an external file. So your script can reference any CSS class just as if it were defined on-page.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Using css classes in external javascript file?
 
Similar Threads
Taglib to attach CSS-File?
layout and multibrowser hell
JSF: tomahawk dataTable rowStyleClass problem while applying alternate colors to rows
JSF - Problems with NetBeans 6.9.1
Activex xmldom nightmare