?
Solved

Problem with <pre> </pre>

Posted on 2006-10-21
6
Medium Priority
?
229 Views
Last Modified: 2010-04-09
I'm trying to use the code below in a web page and want the line to appear as it is below so viewers can see it.

<pre>
document.write('<script src="my_file.js" type=text/javascript></script>');
</pre>

But the output on screen gives me only

document.write('')

What am i doing wrong here?
0
Comment
Question by:dpinto04
[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
  • 4
  • 2
6 Comments
 
LVL 54

Accepted Solution

by:
b0lsc0tt earned 80 total points
ID: 17782691
dpinto04,

The pre tag does not mean that the browser will ignore special characters.  In fact you may not even need the pre tag if that is why you were using it.  Are you using a server language to write this page?  If so they normally have a function that will automatically change the characters for you.  Otherwise you will need to manually do it.  For example look at the characters and corrections below.

< = &lt;
> = %gt;
"  = %quot;

Let me know if you have any questions or need more information.

b0lsc0tt
0
 
LVL 54

Expert Comment

by:b0lsc0tt
ID: 17782694
Text in pre tags will usually preserve spaces and line breaks.  The browser will normally show it in a mono-spaced or fixed-pitch font so it will appear different from the rest.
0
 

Author Comment

by:dpinto04
ID: 17782709
If &quot = " whats it for '
0
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!

 
LVL 54

Expert Comment

by:b0lsc0tt
ID: 17782731
' is &apos; for apostrophe.  Another very common on is & = &amp; for ampersand.
0
 

Author Comment

by:dpinto04
ID: 17782754
Thanks. Alls working fine now :-)
0
 
LVL 54

Expert Comment

by:b0lsc0tt
ID: 17789418
Your welcome!  I'm glad that I could help.  Thank you for the grade, the points and the fun question.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
Originally, this post was published on Monitis Blog, you can check it here . Websites are getting bigger and more complicated by the day. Video, images and custom fonts are all great for showcasing your product or service. But the price to pay in…
In this tutorial viewers will learn how to code links for mobile sites that, once clicked, send a call or text to a specified number. For a telephone link (once clicked, calls a number), begin with a normal "<a href=" link tag. For the href, specify…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.
Suggested Courses

765 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