Solved

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

Posted on 2000-04-14
18
214 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
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 

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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Javascript_Set_dropdown_value 7 40
Outlook opens HTML email as text 4 31
Powershell output to email works, but readability is low 5 39
Filktering Alphabetically 8 32
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…
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).

830 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