using only part of published pages

P

peterken

another weird question

Is there any way of using only PART of another page in a new page WITHOUT
loosing script-functionality of the original page residing on another server
?
I was thinking of running some kind of script which filters out parts of the
original page (eg by specific strings) and replaces it with new code (eg
using document.write())...
Prob seems to be it creates a new page locally, thus loosing the original
pages' functionality...

Method I was thinking about is using layers, loading original page in first
invisible layer, then starting to copy parts of original-to-"new" on a
second visible layer.
Would this method be "too much of the goodies" ?

Only thing I've got at hand is Javascript.

thanks
 
S

Stefan B Rusynko

No - thank goodness




| another weird question
|
| Is there any way of using only PART of another page in a new page WITHOUT
| loosing script-functionality of the original page residing on another server
| ?
| I was thinking of running some kind of script which filters out parts of the
| original page (eg by specific strings) and replaces it with new code (eg
| using document.write())...
| Prob seems to be it creates a new page locally, thus loosing the original
| pages' functionality...
|
| Method I was thinking about is using layers, loading original page in first
| invisible layer, then starting to copy parts of original-to-"new" on a
| second visible layer.
| Would this method be "too much of the goodies" ?
|
| Only thing I've got at hand is Javascript.
|
| thanks
|
|
 
P

peterken

There SEEMS to be a way, found it on http://developer.irt.org/script/510.htm
Any suggestions on this one ?

/**********/
Can I parse the HTML on a page, for example, if I know there's a table on a
page, can I extract out that table and display it alone, say with a
different background, title, headings etc?

This is only possible in Internet Explorer 4 and only if the JavaScript and
document are from the same server. Use a frameset with two hidden frames:
<frameset rows="100%,*,*" onLoad="code.extract()">
<frame src="blank.html" name="blank">
<frame src="code.html" name="code">
<frame src="table.html" name="table">
</frameset>

Then in blank.html:
<body></body>

In code.html:
<html>
<head>
<script language="JavaScript"><!--
function extract()
{
if (document.all)
for (var i=0;i < parent.table.document.all.length; i++)
if (parent.table.document.all(i).tagName == 'TABLE')

parent.blank.document.write(parent.table.document.all(i).outerHTML);
}
//--></script>
</head>

<body>
</body>
</html>

In table.html:
<h1>This shouldn't appear</h1>

<table border="1">
<tr><td>1st row 1st column</td><td>1st row 2nd column</td></tr>
<tr><td>2nd row 1st column</td><td>2nd row 2nd column</td></tr>
</table>

The formatting on the table is then simply down to text manipulation of the
contents of parent.table.document.all(i).outerHTML

// ** SECOND METHOD ********************** /
As pointed out by Clif, it is possible to do this in Internet Explorer 4+
without using a frameset, but instead using a floating frame. Using the
previous table.html and an amended code.html:
<html>
<head>
<script language="JavaScript"><!--
function extract() {
if (document.all)
for (var i=0; i < document.frames[0].document.all.length; i++)
if (document.frames[0].document.all(i).tagName == 'TABLE')
document.all['table'].innerHTML =
document.frames[0].document.all(i).outerHTML;
}
//--></script>
</head>

<body onLoad="extract()">

<iframe src="table.html" style="display:none"></iframe>

<div id="table"></div>

</body>
</html>


No - thank goodness




| another weird question
|
| Is there any way of using only PART of another page in a new page WITHOUT
| loosing script-functionality of the original page residing on another
server
| ?
| I was thinking of running some kind of script which filters out parts of
the
| original page (eg by specific strings) and replaces it with new code (eg
| using document.write())...
| Prob seems to be it creates a new page locally, thus loosing the original
| pages' functionality...
|
| Method I was thinking about is using layers, loading original page in
first
| invisible layer, then starting to copy parts of original-to-"new" on a
| second visible layer.
| Would this method be "too much of the goodies" ?
|
| Only thing I've got at hand is Javascript.
|
| thanks
|
|
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top