How to visualize HTML-code in a javascript-window ??

Hi,

please help! How am I able to visualize (not to execute!!!) html-code in a javascript-popup-window?

e.g. document.write("<hallo>"); should display 'Hallo' in the created js-window.

I can't manage this problem ...

Thanks, Felicitas  
felicitasAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

JonFish85Commented:
try:

document.write("&lt;hallo&gt;")

hope this helps!
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
tewaldCommented:
First the "document.write" has to be placed in the page that is being opened in the popup window.  Try this:

file01 pops up the new window:

<html>
<head>
<title></title>
<script language="javascript" type="text/javascript">
var newWin
function newWindow(theURL,windowName,features) {
     newWin = window.open(theURL,windowName,features);
}
</script>
</head>
<body>
<a href="javascript:newWindow('file02.html','newWindow','toolbars=yes,scrollbars=yes,width=600,height=400')">Open a New Window</a>
</center>
</body>
</html>

file02 writes hallo using document.write:

<html>
<head>
<title></title>
</head>
<body>
<table width="100%">
     <tr>
          <td><script>document.write("Hallo");</script></td>
     </tr>
</table>
</center>
</body>
</html>


Hope this is what you were expecting,

tewald
0
fritz_the_blankCommented:
<html>
<head>
<title>HTML Popup Example </title>
</head>
<body>

&lt;HTML&gt; <br>
&lt;HEAD&gt; <br>
&lt;TITLE&gt; <br>
This is the page title.. <br>
&lt;/TITLE&gt; <br>
&lt;/HEAD&gt; <br>
&lt;BODY&gt; <br>

Place the Body text here... <br>

&lt;/BODY&gt; <br>
&lt;/HTML&gt; <br>

</body>
</html>
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

COBOLdinosaurCommented:
If you have a lot of code to display this way, there is an easier
way then &lt; and &gt;

You can use the depreciated tag <xmp>

Any HTML between <xmp> and </xmp> will be treated as a literal by the
browser.

so document.write('<xmp><table><tr><td width="100"> hello </td></tr></table></xmp>');
would display as <table><tr><td width="100"> hello </td></tr></table>

HTH
Cd&
0
ahosangFinance Systems DeveloperCommented:
This question has been abandoned. I will make a recommendation to the moderators on its resolution in a week or two. I appreciate any comments that would help me to make a recommendation.
 
In the absence of responses, I may recommend DELETE unless it is clear to me that it has value as a PAQ. Silence = you don't care
 
ahosang
0
COBOLdinosaurCommented:
JonFish85 was the first to answer the question as originally posted IMHO.

Cd&
0
fritz_the_blankCommented:
This is strange...

I never made the post above....

Fritz the Blank
0
COBOLdinosaurCommented:
You can remember back that far?

Cd&
0
fritz_the_blankCommented:
Even at my age!!!! Actually, it's because I have never used &gt;

Fritz the Blank
0
ahosangFinance Systems DeveloperCommented:
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

points to JonFish85
Please leave any comments here within the next seven days.
 
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
 
ahosang
EE Cleanup Volunteer
0
NetminderCommented:
Per recommendation, force-accepted.

Netminder
EE Admin
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
JavaScript

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.