-
displaying HTML code in frame?
Does anyone know a way of displaying the HTML code from one frame in another,
complete with tags?
I've been trying document.write, and pre /pre tags, but the browser still
seems to be trying to interpret the tags in what I want to be plain text.
Can it be done?
-
Re: displaying HTML code in frame?
Try with <xmp>the html code</xmp>, or convert "<" and ">" to respectively
"<" and ">".
cya
Frederiek
"mat311275" <mat.j@excite.co.uk> wrote:
>
>Does anyone know a way of displaying the HTML code from one frame in another,
>complete with tags?
>I've been trying document.write, and pre /pre tags, but the browser still
>seems to be trying to interpret the tags in what I want to be plain text.
>Can it be done?
-
Re: displaying HTML code in frame?
In IE, place a <div> tag in the target frame and set its innerText property
to the innerHTML property of the body tag from the source frame. Here's an
example. It doesn't use frames, but the concept is identical.
<HTML>
<HEAD>
<TITLE></TITLE>
</HEAD>
<BODY>
<input type="button" value="Move HTML" onclick="moveHTML();"><br>
<div id="source" style="LEFT: 7px; WIDTH: 250px; POSITION: absolute; TOP:
57px"><h1>Header</h1><br><p>Click the button to move this text into the
other div</p></div>
<div id="target" style="LEFT: 299px; WIDTH: 250px; POSITION: absolute; TOP:
62px; HEIGHT: 142px">This is the target div</div>
</BODY>
</HTML>
<script language="JavaScript">
function moveHTML() {
var source = document.getElementById("source");
var target = document.getElementById("target");
target.innerText = source.innerHTML;
source.innerHTML = "Contents moved!"
}
</script>
Russell Jones
Sr. Web Development Editor
DevX.com
"Frederiek" <fourwaysstreet@chello.be> wrote in message
news:3a796ac5$1@news.devx.com...
>
> Try with <xmp>the html code</xmp>, or convert "<" and ">" to respectively
> "<" and ">".
>
> cya
> Frederiek
>
>
> "mat311275" <mat.j@excite.co.uk> wrote:
> >
> >Does anyone know a way of displaying the HTML code from one frame in
another,
> >complete with tags?
> >I've been trying document.write, and pre /pre tags, but the browser still
> >seems to be trying to interpret the tags in what I want to be plain text.
> >Can it be done?
>
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks