/    Sign up×
Community /Pin to ProfileBookmark

Verbatim string pls help

Hi all
I want the following line to appear on my PAGE, not the HTML document

<script type=”text/javascript” src=”foo.js”> </script>

I tried using <pre> tag or <verbatim> it wouldn’t work. When opened, the line just disappears.

ANy ideas?

to post a comment
HTML

2 Comments(s)

Copy linkTweet thisAlerts:
@NogDogOct 11.2004 — <i>
</i>&amp;lt;script type="text/javascript" src="foo.js"&gt; &amp;lt;/script&gt;
Copy linkTweet thisAlerts:
@David_HarrisonOct 11.2004 — As a genral rule, there are 3 special characters that you cannot use on your page without encoding them first, these characters are "&lt;" "&gt;" and "&amp;". The &lt; and &gt; characters are obviously used for HTML and the &amp; symbol is used when encoding characters, therefore if you just want &amp; to show on the page and you do not encode it then sometimes it can cause problems. To encode these symbols you need to do this:

< is &amp;lt;
> is &amp;gt;

&amp; is &amp;amp;


Therefore NogDog's solution was half right, but you really should go all the way and write it like this:

&amp;lt;script type="text/javascript" src="foo.js"&amp;gt; &amp;lt;/script&amp;gt;
×

Success!

Help @Cortes spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.6,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...