473,321 Members | 1,778 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,321 software developers and data experts.

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
createStyleSheet. Which looks like an IE only method. They all seem a
bit odd to me. Anyone?

Thanks,
Vincent

Jul 23 '05 #1
1 1263
Ivo
"Vincent van Beveren" wrote
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
createStyleSheet. Which looks like an IE only method. They all seem a
bit odd to me. Anyone?


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
Jul 23 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Rainer Nopper | last post by:
Hallo, Wie kann ich einem editierbarem IFrame (für WYSIWYG-Editor) bzw. dessen html-dokument, ein anderes, externes Stylesheet zuweisen? Wenn ich in das geladene IFrame-Dokument...
7
by: Vincent van Beveren | last post by:
Hi everyone I have a JavaScript app that creates an IFRAME through DOM (createElement('IFRAME')) However, that IFRAME does not have any content yet. ...
3
by: juergen.riemer | last post by:
Hi all, I have a problem in attaching an external stylesheet to a newly created iframe in Firefox (1.5.0.2). If I use the code below (with a relative address to the file) the stylesheet would...
10
by: AC | last post by:
I had a page that does some event setup on window.onload: function prepEvents() { document.getElementById("menumap_sales").onmouseover = swapMenuSales; // etc } window.onload = prepEvents;
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.