The Official Blog of Patcoola

Im just a dude watching over my parents,
and trying to make cartoons and video games from home.

Script: View Style Sheet [JS]

Important!

Dear visitors,

This blog and the Tigarus.com network will be changing our website software in May (2024). There will be some down time and there will be a change to the webpage addresses.

We will also be removing the Anime blogs. The Rocksmith Songs website will be unavailable of a few weeks or months while I move the database to the new software.

At the moment we are running on Wordpress, the new software is an in-house project which is 57 times faster. It will also provide more freedom for development.

Thank you for understanding.

, By Patcoola

Script Title: viewStyleSheet
Programming Language: Java Script
Date Completed: 2012/11/23

Purpose: View the rules and it’s properties of a Cascading Style Sheet (CSS) in an array.

Advertisement

Donate Now!

This might not be the best time, but making a blog is not easy. Would you consider donating?


Description: Select the HTML Document Style Sheet and view it’s contents as an array.
Returns a one dimensional array. Returns array[0] as Access is denied if the style sheet does not exist or if the external style sheet is not accessible. Returns undefined if the function argument is not a number or the index is higher than the amount of style sheets.

Note: Modern Web browsers may return short hand CSS Rules as short hand, older Web browser such as IE7 will return short hand in it’s full expanded form.

Compatibility:

External Style Sheet Support: Firefox, Opera 12
In DOM Style Sheet Support: Firefox, Chrome, Opera 11, MSIE 7
Not Tested: Netscape, Safari

Method:

viewStyleSheet ( index_i );

Example Usage:

HTML

<style type=”text/css”>
/* my style sheet */
p {
color: black;
}
</style>

Java Script

var myArray = viewStyleSheet ( 0 );

document.write( myArray[0] );

Returns p {color:black;}

 

Advertisement

Donate Now!

This might not be the best time, but making a blog is not easy. Would you consider donating?


 

Post Meta

Share Post

 

Comments: Write Comment

Be the first to write a comment.


Leave a Comment


All comments are reviewed before publishing. Comments must be related to the page topic, must not be spam, and must comply with the criminal code of Canada.