473,382 Members | 1,147 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,382 software developers and data experts.

Embedding and Printing XHTML

Hi,

I'm trying to set up a webpage so that I can view multiple HTML files
from the same page. For example, you might go to
http://example.com/lab_tests.html and be able to view lab1.html,
lab2.html, and lab3.html right on that page. If you're viewing this
message w/a monospace font, the page layout might look like this:

+-------------------+
| Header | * Code for Header and
+------+------------+ Menu located in
| | | `lab_tests.html'.
| Menu | Lab Report |
| | | * Code for Lab Report
+------+------------+ in `lab2.html'.

I have two questions for the readers of this newsgroup:

(1) What are my options for embedding `lab#.html' into the page, if I
don't want to use frames? (I'm using XHTML 1.0 Strict.) I know I can
use the `object' element. Is there a way I can use JavaScript to read
the innerHTML of `lab#.html' from `lab_tests.html'? (Naturally the
method I use here will complicate my second question.)

(2) Once I put this page together, is there a way I could set up a way
to print just the Lab Report from the main page? I don't know how to
do this if I embed the report in an `object' element. If I could use
JavaScript to read the innerHTML of a separate lab file and add it to
the DOM of the main page, perhaps I could use a media="print"
stylesheet to display only the report.

Ideas?

Alan

Jul 23 '05 #1
8 1760
"Alan Lue" <al*****@yahoo.com> wrote in message
news:11**********************@o13g2000cwo.googlegr oups.com...
Hi,

I'm trying to set up a webpage so that I can view multiple HTML files
from the same page. For example, you might go to
http://example.com/lab_tests.html and be able to view lab1.html,
lab2.html, and lab3.html right on that page. If you're viewing this
message w/a monospace font, the page layout might look like this:

+-------------------+
| Header | * Code for Header and
+------+------------+ Menu located in
| | | `lab_tests.html'.
| Menu | Lab Report |
| | | * Code for Lab Report
+------+------------+ in `lab2.html'.

I have two questions for the readers of this newsgroup:

(1) What are my options for embedding `lab#.html' into the page, if I
don't want to use frames? (I'm using XHTML 1.0 Strict.) I know I can
use the `object' element. Is there a way I can use JavaScript to read
the innerHTML of `lab#.html' from `lab_tests.html'? (Naturally the
method I use here will complicate my second question.)

(2) Once I put this page together, is there a way I could set up a way
to print just the Lab Report from the main page? I don't know how to
do this if I embed the report in an `object' element. If I could use
JavaScript to read the innerHTML of a separate lab file and add it to
the DOM of the main page, perhaps I could use a media="print"
stylesheet to display only the report.

Ideas?

Alan


Here's something like it that uses iframes.

It displays 3 across using the "site" array.

<html>
<head>
<title>Sites.htm</title>
<script type="text/javascript">
var site = new Array();
site[1] = "http://www.domain1.com";
site[2] = "http://www.domain2.com";
site[3] = "http://www.domain3.com";
site[4] = "http://www.domain4.com";
site[5] = "http://www.domain5.com";
site[6] = "http://www.domain6.com";
var ifra = "' style='width:320; height:120' frameborder='1'";
ifra += " marginwidth='0' marginheight='0' scrolling='yes'></iframe>\n";
var html = "<table border='0' width='980'>\n";
html += "<tr>\n";
for (var i=1; i<site.length; i++) {
html += " <th height='150'>\n";
html += " <iframe src='" + site[i] + ifra;
html += " <br><a href='" + site[i] + "' target='_blank'>" +
site[i].substr(11) + "</a>\n";
html += " </th>\n";
if (i % 3 == 0) {
html += "</tr>\n";
html += "<tr>\n";
}
}
html += "</tr>\n";
html += "</table>\n";
document.write(html);
</script>
</head>
<body margintop="0" marginleft="0">
</body>
</html>
Jul 23 '05 #2
McKirahan wrote:
"Alan Lue" <al*****@yahoo.com> wrote in message
news:11**********************@o13g2000cwo.googlegr oups.com...
[...]
(1) What are my options for embedding `lab#.html' into the page, if I
don't want to use frames? (I'm using XHTML 1.0 Strict.) I know I can

[...]
Here's something like it that uses iframes.


If the OP specifically requests *not* frames, why suggest
frames?

You can't use iframes with XHTML 1.0 strict and have it pass
validation. XHTML Transitional might suit, or the OP can create
a custom DTD and do whatever.

--
Zif
Jul 23 '05 #3
Right, right, right; well said. I'm trying to do this without frames.

I guess I'm wondering whether it's possible to use CSS to style and
display a JavaScript-modified DOM.

The other thing I want to know is if there's some way I can use
JavaScript to read a separate HTML file into the current one. I
suspect that I'll need to use something else in conjunction... maybe
Java or something.

Anyway, I'd appreciate any insight.

Thanks,
Alan

Jul 23 '05 #4
"Zifud" <Zi***@hotmail.com> wrote in message
news:Ci****************@news.optus.net.au...
McKirahan wrote:
"Alan Lue" <al*****@yahoo.com> wrote in message
news:11**********************@o13g2000cwo.googlegr oups.com...

[...]
(1) What are my options for embedding `lab#.html' into the page, if I
don't want to use frames? (I'm using XHTML 1.0 Strict.) I know I can

[...]
Here's something like it that uses iframes.


If the OP specifically requests *not* frames, why suggest
frames?


[snip]

iframes <> frames
Jul 23 '05 #5
"Zifud" <Zi***@hotmail.com> wrote in message
news:Ci****************@news.optus.net.au...
McKirahan wrote:
"Alan Lue" <al*****@yahoo.com> wrote in message
news:11**********************@o13g2000cwo.googlegr oups.com...

[...]
(1) What are my options for embedding `lab#.html' into the page, if I
don't want to use frames? (I'm using XHTML 1.0 Strict.) I know I can

[...]
Here's something like it that uses iframes.


If the OP specifically requests *not* frames, why suggest
frames?


[snip]

iframes != frames
Jul 23 '05 #6
Sorry McKirahan; you're right abt that, though iframes won't solve the
problem. They're part of XHTML Transitional but not Strict.

Alan

Jul 23 '05 #7
If you are using "strict" isn't there an xml declaration at the top of
the page?

If there IS, then couldn't you read the pages as XML using the IE
ActiveX and mozilla xmlhttprequest objects to retrieve the pages with
javascript?

If that could work, then you would just have to parse the document tree
and get all the nodes that you need to display the content.

Haven't tried it, just an idea.

Jul 23 '05 #8
Alan Lue wrote:
Sorry McKirahan; you're right abt that, though iframes won't solve the
problem. They're part of XHTML Transitional but not Strict.


And, in the long term, not part of XHTML at all, since 1.1 and 2.0 are
Strict only.

---
John W. Kennedy
"Only an idiot fights a war on two fronts. Only the heir to the throne
of the kingdom of idiots would fight a war on twelve fronts"
-- J. Michael Straczynski. "Babylon 5", "Ceremonies of Light and Dark"
Jul 23 '05 #9

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

Similar topics

5
by: Raphael Goubet | last post by:
Hi, Is it possible to insert an SVG graphic directly in an XHTML file (ie, not through a reference to an external file, but by directly placing the SVG structure within the XHTML structure)? ...
1
by: shea | last post by:
I have an XML data type which I would like to display in my HTML. The data type looks somthing like this: <package name="helloworld"> <description> This is a program which prints hello world to...
53
by: Andrew Poulos | last post by:
I've got some CSS that looks like this: body { margin: 0; font-family: Arial, Helvetica, sans-serif; font-size: 140.01%; color: #000000; } but IE won't apply the font size to text in table...
3
by: alice | last post by:
I've been trying for a long time to figure this out, to have a page with several MP3 clips, and each one having a custom start and stop button next to them to play the track. I finally found a bit...
8
by: Neo Geshel | last post by:
Greetings. BACKGROUND: My sites are pure XHTML 1.1 with CSS 2.1 for markup. My pages are delivered as application/xhtml+xml for all non-MS web clients, and as text/xml for all MS web...
8
by: Good Man | last post by:
Hi there We've found a fantastic solution for generating PDF documents with fairly complex XHTML and CSS. It does a great job (on all our tests so far...) It's called "Prince" (...
3
neo008
by: neo008 | last post by:
Hi all, I want to embedd Excel sheet into my application for "Bill" printing. I dont need to modify contents as Bill data is already saved in database through another interface. I just want...
0
by: Thomas Schreiner | last post by:
Hi, I'm extending a windows application (C++) by embedding Python calls. It seems to be a known problem that windows applications detach immediately from the calling console, so that all output...
0
by: sanjeewa19 | last post by:
Hi Forum, Im in the process of developing a mobile website.This is just a static website so Im using pure HTML in Dreamweaver with the DOCTYPE is set to XHTML Mobile 1.0 I have got a...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

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.