adding a stylesheet to an IFRAME

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Vincent van Beveren

    adding a stylesheet to an IFRAME

    Hey everyone,

    Currently I'm writing some software that appends an IFRAME to a document
    (though DOM). The IFRAME is empty. Now I want to assign a stylesheet to
    that document, but I don't know what the 'best' way would be (read: the
    most complient to standard). I could ofcourse use document.write to fill
    the document with a head and <LINK> tags. I could also create LINK tag
    through DOM create element and attach that, or I could use
    createStyleShee t. Which looks like an IE only method. They all seem a
    bit odd to me. Anyone?

    Thanks,
    Vincent

  • Ivo

    #2
    Re: adding a stylesheet to an IFRAME

    "Vincent van Beveren" wrote[color=blue]
    > Currently I'm writing some software that appends an IFRAME to a document
    > (though DOM). The IFRAME is empty. Now I want to assign a stylesheet to
    > that document, but I don't know what the 'best' way would be (read: the
    > most complient to standard). I could ofcourse use document.write to fill
    > the document with a head and <LINK> tags. I could also create LINK tag
    > through DOM create element and attach that, or I could use
    > createStyleShee t. Which looks like an IE only method. They all seem a
    > bit odd to me. Anyone?[/color]

    My vote goes to the DOM. It is fast, clean and easy if you follow the rules.
    You probably want to use DOM for other manipulations too.
    document.write( ) is reputedly more demanding of the engine, requires
    escaping of quotes etc.
    Odd indeed, but nevertheless.
    Ivo


    Comment

    Working...