SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member roughrider's Avatar
    Join Date
    May 2003
    Location
    USA
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    CSS within javascript file?

    Hello,
    Is it possible to use javascript to call css, as in having css related things in a js file, and have it being loaded at the same time as the script is running?A friend of mine was asking me and I told him I would check on it because I wasn't sure if you could have any css in a javascript file.

  2. #2
    SitePoint Wizard silver trophy
    Join Date
    May 2003
    Posts
    1,843
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Virtually everything involved in CSS, from style sheets themselves to their effect on elements, is exposed (made available for programming) through the Document Object Model. Naturally, the syntax is sometimes different and the format varies, but it essentially manipulates styles through the 'back door', as opposed to the 'front door' (pre-rendering) effects of CSS. Warning: you can't manipulate an element's style until it's been parsed.

    http://www.w3schools.com/dhtml/dhtml_intro.asp

  3. #3
    SitePoint Member roughrider's Avatar
    Join Date
    May 2003
    Location
    USA
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for the response.I will do some more investigating and see what I can come up with.I am familiar with css but not too familiar with javascript, so this is going to be fun .


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •