Solved

Replacement of < or > in HTML-code....

Posted on 2000-04-14
18
207 Views
Last Modified: 2010-04-09
Is there some other character that have the same function as the < (smaller than) and > (more than) within pure HTML-code ?
A common row is:
<HEAD> and </HEAD>

I need to use some other character instead of the < and >, but I want the browser to use the same interpretation..

Funny question, however I need to know since I will generate my HTML-code from a very different system than the usual ones (ASP, CGI etc)..

Thanx !

/Erik N
0
Comment
Question by:Erik N
  • 7
  • 2
  • 2
  • +5
18 Comments
 

Expert Comment

by:etromic
ID: 2716897
Hmm I know that you can try this... for < you can use: &#60; and for > you can use &#62;

but I'm not 100% that they actually will be written as tags.
0
 

Expert Comment

by:drew_moffat
ID: 2716898
Sorry, no.
0
 

Author Comment

by:Erik N
ID: 2717008
Right ! It didn't work....

/Thanx !
0
VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

 

Author Comment

by:Erik N
ID: 2717014
Adjusted points from 200 to 450
0
 
LVL 84

Expert Comment

by:ozo
ID: 2717053
&lt;HEAD&gt; and &lt;/HEAD&gt
or
<pre>
<HEAD> and </HEAD>
</pre>
0
 
LVL 33

Expert Comment

by:knightEknight
ID: 2717083
>> I will generate my HTML-code from a very different system than the usual ones (ASP, CGI etc)..

Indeed!  If by this you mean a batch file (.bat) or NT command file (.cmd) I highly recommend against that as it is a major security hole.  You would basically be giving the whole world a command-prompt to your web server with Administrator permissions.

A klugy alternative would be to use [ and ] and then use another process or filter to convert these to < and > on the fly.
0
 

Expert Comment

by:drew_moffat
ID: 2717126
Sorry Eric,

I had to try that answer...far as I know, those are the tags for html...might wamt to go to <http://www.w3.org> and see if you can find what your looking for.

good luck,

Drew
0
 

Author Comment

by:Erik N
ID: 2717237
To KnightEKnight: No, this is not a bat- or command-generated HTML-code. This is a code generated using a CAM-system..

/Thanx !
0
 

Author Comment

by:Erik N
ID: 2717268
&lt;HEAD&gt; didn't work either. It caused the browser to output the < - character. This is not what I want. I want to find a character that the browser interprets in the same way it does with <, that is: find a character that can be used in HTML-code to indicate to the browser that "this is a html-word", just like with the < - character...


Thanx !
0
 
LVL 33

Expert Comment

by:knightEknight
ID: 2717282
I guess writing your own browser is out of the question.   ;)
0
 
LVL 2

Expert Comment

by:DKostov
ID: 2717463
The only solution is the knightEknight's first one :). Write a cgi that will accept the browser's request, then will parse the source file, change it to HTML and send it back to the browser. If the source file is static, you can convert it before to put it on the Internet. That will be faster.
0
 
LVL 84

Expert Comment

by:ozo
ID: 2717695
There is no other character that the browser interprets in the same way it does with <,
can you explain why you don't want to use <, or what you would do if there was such a character?
0
 
LVL 22

Expert Comment

by:CJ_S
ID: 2718676
Indeed, you might want to have a translation table to convert every special case word to normal HTML. A browser only accepts the normal < > signs and doesn't know how to interpret something else. That's a main html file. Another option for you is to use only document.write statements, true, you have to write out the whole HTML code in the document.write( )-function.

A Translation table, like KeK already pointed out, will take a normal document, and see if that document contains any of those translations, if there is, it'll change that word to the html code you want.
0
 
LVL 1

Expert Comment

by:enkidu
ID: 2720760
Well it is quite simple.  What you are asking for is an escape sequence.  These escape sequences allow you to display characteres or symbols that you would not normally have on you keyborad or ones that would be considered a part of the HTML document.

The escape sequences for < and > are &lt; and &gt; respectively.
0
 

Author Comment

by:Erik N
ID: 2723788
Ok enkidu, I already tried this (read ozo:s comment, the 3rd one)....

However, I solved this in another way, but I want to thank you all for trying..

Thanx !

/Erik N
0
 

Author Comment

by:Erik N
ID: 2723824
I have another question though:

I use this to put an editable field on the page:

<CENTER>
<TEXTAREA ROWS=5 Name="Text Area 1" WIDTH="250">
Note:
</TEXTAREA><P>
</CENTER>

However, I doesn't seem to be able to adjust the width of the field, no matter what I write to the width-variable. I tried to set it at 450, but this didn't change anything....

Maybe some of you can give me a gradable answer to this ?

/Erik
0
 
LVL 1

Accepted Solution

by:
enkidu earned 450 total points
ID: 2724893
For the <TEXTAREA> tag you do not use the width attribute, instead you use the COLS="number here" attribute.
0
 

Author Comment

by:Erik N
ID: 2727826
Nice !
Thanx
/Erik
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
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…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

810 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