[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

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

Posted on 2001-08-23
11
Medium Priority
?
252 Views
Last Modified: 2008-03-10
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  
0
Comment
Question by:felicitas
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
  • 2
  • +3
11 Comments
 
LVL 6

Accepted Solution

by:
JonFish85 earned 1200 total points
ID: 6419005
try:

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

hope this helps!
0
 
LVL 2

Expert Comment

by:tewald
ID: 6419021
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
 
LVL 46

Expert Comment

by:fritz_the_blank
ID: 6419396
<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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 6419581
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
 
LVL 12

Expert Comment

by:ahosang
ID: 7961562
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
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 7961732
JonFish85 was the first to answer the question as originally posted IMHO.

Cd&
0
 
LVL 46

Expert Comment

by:fritz_the_blank
ID: 7961769
This is strange...

I never made the post above....

Fritz the Blank
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 7961795
You can remember back that far?

Cd&
0
 
LVL 46

Expert Comment

by:fritz_the_blank
ID: 7967171
Even at my age!!!! Actually, it's because I have never used &gt;

Fritz the Blank
0
 
LVL 12

Expert Comment

by:ahosang
ID: 8021800
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
 
LVL 5

Expert Comment

by:Netminder
ID: 8092796
Per recommendation, force-accepted.

Netminder
EE Admin
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Having worked on larger scale sites, we found out that you are bound to look at more scalable solutions to integrating widgets, code snippets or complete applications and mesh them into functional sites, in any given composition. To share some of…
This article discusses how to create an extensible mechanism for linked drop downs.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question