View Single Post
  #7 (permalink)  
Old June 25th, 2007, 07:49 AM
arnabghosh arnabghosh is offline
Friend of Wrox
Points: 686, Level: 9
Points: 686, Level: 9 Points: 686, Level: 9 Points: 686, Level: 9
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2005
Location: Kolkata, West Bengal, India.
Posts: 128
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks Ehsan Zaery Moghaddam !!!

I tried the above code for style sheets but did not work.

I used
alert(document.styleSheets.length);

to check if the style sheet could be copied but the result was that the alert gave a '0' value in return for the length, which means it could not get the style sheets.

my style sheets are as follows:
<STYLE TYPE="TEXT/CSS">
.TextOnHeader
{
FONT-SIZE:10 pt;
FONT-FACE:Arial;
FONT-WEIGHT:BOLD;
}
.TextOnData
{
FONT-SIZE:8 pt;
FONT-FACE:Arial;
}
TD
{
    FONT-FAMILY:Arial;
    FONT-SIZE:8pt;
}
INPUT
{
    FONT-FAMILY:Arial;
    FONT-SIZE:8pt;
}
SELECT
{
    FONT-FAMILY:Arial;
    FONT-SIZE:8pt;
}
</STYLE>

This is in the head section.
I have used yur javascript code as:
for(var i=0; i<document.styleSheets.length; i++)
    {
        document.getElementById("saveFrame").document.crea teStyleSheet(document.styleSheets[i].TextOnHeader);
    }

may be I have missed something.

Anyway thanks A lot for letting me know a few new things.
Reply With Quote