Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

JavaScript Forum


You are currently viewing our JavaScript Forum as a guest. Please register to participate.
Login



Reply
Access cssText of an imported stylesheet
Old 12-01-2008, 11:19 PM Access cssText of an imported stylesheet
Junior Talker

Posts: 1
Trades: 0
Hi..of course I'm new to CSS.. I have imported a style sheet and now I want to print all of the rules.

For NON-imported styles I use this..

document.write(document.styleSheets[0].cssRules[0].cssText)

and it nicely prints out the style. However , the second style sheet comes from an import so

document.write(document.styleSheets[1].cssRules[0].cssText)

just prints out

@import url(http://www.bedbathandbeyond/css/newmain.css);


How do I see the styles in the import? I tried to use ownerRule and parentStyleSheet but neither worked. Below are failed attempts. I'm using Firefox- Help please!

document.styleSheets[0].parentStyleSheet.cssRules[0].cssText
document.styleSheets[0].ownerRule.cssText
document.styleSheets[0].ownerRule[0].cssText
binja is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Reply     « Reply to Access cssText of an imported stylesheet
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.41486 seconds with 12 queries