View Full Version : cssText is not working in FIREFOX
battasrinivasa
06-08-2005, 03:04 PM
hi there,
i am using document.styleSheet[i].cssText to display the style sheet content. it is working fine in IE but it is not working in FIREFOX.
any help on this...?
thank you in advance
_Aerospace_Eng_
06-08-2005, 06:35 PM
That isn't enough information for us to go by, can you please show us your code or give us a link to the page?
battasrinivasa
06-10-2005, 04:09 PM
hi
here is my code.
---------------------
function showcss()
{
alert('hello');
var i,j;
var a=document.styleSheets;
if (a.length==0)
alert("No Style Sheets found...");
else
{
var s='<div style=\\"font:x-small verdana\\"><h1>Style sheet info for '+location.href+'</h1>';
for (i=0;i<a.length;i++)
{
var ss=a[i];
if (document.styleSheets[i].owningElement.tagName.toUpperCase()=="STYLE")
{
for (j=0;j<document.styleSheets[j].imports.length;j++)
{
s+='<h2>Style Sheet '+(i+1)+': '+document.styleSheets[i].imports[j].href+'</h2>';
s+='<h2>Media: '+document.styleSheets[i].imports[j].media;
s+=' | Title: '+document.styleSheets[i].imports[j].href.title+'</h2>';
s+='<h3>Rules:</h3>'+document.styleSheets[i].imports[j].cssText;
s+='<hr>';
}//end for loop
}
else
{
s+='<h2>Style Sheet '+(i+1)+': '+ss.href+'</h2>';
s+='<h2>Media: '+ss.media;s+=' | Title: '+ss.title+'</h2>';
s+='<h3>Rules:</h3>'+ss.cssText;
s+='<hr>';
}//end if loop
}//end for loop
var a=s.split('\n');
s=a.join('<br/>');
s=s.toLowerCase()+'</div>';
var cw=window.open('', 'cw', '');
cw.document.open();
cw.document.write(s);
cw.document.close();
}//end if loop
}//end of function
---------------------
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.