Solved

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

Posted on 2000-04-14
18
187 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
 

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
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Do you want to insert HTML5 video into your site? This is the tutorial how to do so. What are the main advantages of HTML5 video? 1) Have good compression, good image quality, and low decode processor use. 2) It is royalty-free 3) It is easi…
Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
In this Micro Tutorial viewers will learn how to create navigation buttons that change on rollover, using CSS (Continuation of the CSS Image Sprite tutorial) Create a parent ID for all the list items       - Specify position: absolute and display: block…
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…

746 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now