...

View Full Version : How does one official escape tags, or what is otherwise known as code?



SpiritualStorms
10-23-2004, 04:12 AM
Lets say i want to basically create a tutorial page, and on that page, i want to talk about specific pieces of code, or tags. How would i do that? In other words, if i want to talk about the table tags, i dont want the browser thinking that i am in fact trying to create a table.

Kurashu
10-23-2004, 04:34 AM
Use &lt; for the <, and &gt; for the >

Hope that helps. =)

SpiritualStorms
10-23-2004, 04:37 AM
Use &lt; for the <, and &gt; for the >

Hope that helps. =)

Not really. I will need an actual example.

brothercake
10-23-2004, 04:47 AM
Like this:


<p>Here's how to make a paragraph in HTML:</p>
<pre><code>
&lt;p&gt;Some text here&lt;/p&gt;
</code></pre>

liorean
10-23-2004, 05:11 AM
If you are using XML, you can use CDATA blocks as well. Inside them, everything will be treated as raw text. They begin with <[CDATA[ and end with ]]>. They are a feature of SGML, so theoretically they should be supported in HTML too, but sadly this is only in theory as real world browsers do typically not support CDATA blocks in HTML.

mindlessLemming
10-23-2004, 05:28 AM
Lets say i want to basically create a tutorial page, and on that page, i want to talk about specific pieces of code, or tags. How would i do that? In other words, if i want to talk about the table tags, i dont want the browser thinking that i am in fact trying to create a table.

& lt; table & gt; (remove spaces)
If you don't want to convert all your code samples, you can use a php script which does the conversion on the fly -- making it far easier to update examples.
I use david house's Wordpress plugin (http://xmouse.ithium.net/archives/2004/07/25/grabcode-documentation) of Dunstan's code insertion script (http://1976design.com/blog/archive/2004/07/29/redesign-tag-transform/). This allows you to store you code samples as individual files in a folder structure of your choice as opposed to inserting the code in the page mark-up. The <ol> structure of the code stops it from screwing up a fixed width layout -- very handy :D

lol.. when I pressed reply there were no responses. That's what you get for wandering off for an hour mid-post.

SpiritualStorms
10-23-2004, 06:35 AM
I did some digging, and i got it now what you meant by this:



from kurashu

Use &lt; for the <, and &gt; for the >

Hope that helps. =)




from brothercake:

<p>Here's how to make a paragraph in HTML:</p>
<pre><code>
&lt;p&gt;Some text here&lt;/p&gt;
</code></pre>



So if i wanted to include the less-than sign, ( i.e "<" ), i would basically escape it by literally typing "&lt;". Once i did that, i would then basically throw in the name of the tag i am interested in escaping. The third step would be to basically throw in the &gt; in order to have the greater-than sign, ( i.e ">" ).

However before i do any of the above signs, i need to have the pre tags, correct?

In essence then, all i am doing is escaping the greater-than, and less-than signs, nothing more.

The above is what i am concluding from the following link:

http://oregonstate.edu/instruct/coursedev/tutorials/media/hypertext.htm

And the &amp is for spacing, correct?

SpiritualStorms
10-23-2004, 06:45 AM
You know, as i think about the above, i think a JavaScript function would be like absolutely awesome. What you think?


function escapingTagCode( param1 ){

var start="&lt;"
var end="gt;"
var value="";

if(param1){
value=start+param1+end;
}
else
{
alert("There is no parameter specified for this function.");
}
return value;
}

The above would be nice, but how then do you call it without a link, or a button acting as a trigger for the function?

Kurashu
10-23-2004, 06:46 AM
&amp; makes the amperstand(&) symbol, and <pre>...</pre> is just preformatted text.

SpiritualStorms
10-23-2004, 06:59 AM
from Kurashue:

&amp; makes the amperstand(&) symbol, and <pre>...</pre> is just preformatted text.


So i dont need them, then? And what is meant by <code> and </code>?

Scootertaj
10-23-2004, 05:54 PM
Hey,
I'm not sure if this will help or not but
But I believe
<code> and </code> make text appear like this
this is what happens when you have <code> and </code> . Hope this helps!

I'm probably wrong because that only does that in this forum, not sure though!

AaronW
10-23-2004, 06:06 PM
<pre> tags are preserved-formatting text ;) That is, white space in a pre tag will not wrap. The only way to get a linebreak inside a pre tag is to use <br /> (or adjust the white-space via CSS)

<code> tags will help you style the code examples in your CSS document. <pre> tags will preserve the formatting of large blocks of code. Inline code examples could just be wrapped in <code>.

Basscyst
10-23-2004, 08:02 PM
Another way it could be done, may not be so nice though, but it would work.

Just throw the example into a <textarea onfocus='this.blur();'><a href="http://yourURL.com">Yay</a></textarea>

Basscyst

Willy Duitt
10-23-2004, 08:35 PM
Although officialy deprecated and not recommended there always is the <XMP> tag...

.....Willy

llizard
10-23-2004, 11:00 PM
<pre> tags are preserved-formatting text ;) That is, white space in a pre tag will not wrap. The only way to get a linebreak inside a pre tag is to use <br />

This is not quite correct. With <pre>, simply hitting the carriage return (enter button) will cause a line break. If <br /> is added, the lines in the preserved-formatted fixed-width text will be double spaced. White space in pre stays exactly as it is in the coding and does not require the use of &nbsp; to keep it there (unless of course, the wags at w3c have changed something so that <pre> suddenly acts differently)

Here is a little page I wrote about using the <pre> tag for displaying ASCII-art:

http://llizard.crosswinds.net/cwc/asciionpage.htm

However, having said all that, if I were going to rewrite that page, I would now use the <code> tag for the coding examples as I did on the page I wrote about popup links (http://llizard.crosswinds.net/cwc/popuplinks.html)

SpiritualStorms
10-23-2004, 11:27 PM
I think i like your suggestion:



from Basscyst:

Another way it could be done, may not be so nice though, but it would work.

Just throw the example into a <textarea onfocus='this.blur();'><a href="http://yourURL.com">Yay</a></textarea>

Basscyst


Somehow that seems easier on the eyes, and mind, than "&lt;p&gt;". Maybe it's just me, but it tweaks with my eyes. It seems to criss-cross them. Like an infinite spiral of criss-crossings inside my head.

SpiritualStorms
10-23-2004, 11:45 PM
To llizard:

I checked out your tutorial (the one on popups). Major props to you. Definitely within my style of thinking. Greate co-ordination of colors too between the font, and the background. People dont realise how much of a role color schemes play in the issue of readability. I have a tendancy to stick within the same family of colors, but of different shades when it comes to doing any webpages. I personally think that white is too bright on the eyes. For this reason, i generally choose a color for the background. I hardly ever do any webpages where the backdrop is white.

At any rate, i liked your tutorial. I also liked how the link highlighter switched positions as you read down the page. As i looking at your menu, it made me think of a meter like effect where, you would have basically a needle pointing down on a particular menu item as it moved a long a bar. But thats another story.

At any rate, i was looking up your code to see how you did the code part, and i am blowing away at the friggin complexity of the thing:


<p class="s3a">

<code>
&lt;a href=&quot;<strong class="grn">http://link</strong>&quot; title=&quot;<strong>link name</strong>&quot;<br>
onclick=&quot;window.name='main';<br>
<a name="alrt" class="alrt" title="must be in one line in coding (ie: no line breaks)">window.open(this,'popup','scrollbars=1,resizable=1,'+</a><br>

<a name="alrt" class="alrt" title="must be in one line in coding (ie: no line breaks)">'width=<strong>590</strong>,height=<strong>400</strong>,left=<strong>20</strong>,top=<strong>20</strong>');</a><br>
return false;&quot;</a><br>
<a href="#alrt" class="alrt" title="must be in one line in coding (ie: no line breaks)">onmouseover=&quot;setAttribute('title', this.title + '<strong> opens in a popup</strong>')&quot;&gt;link&lt;/a&gt;</a>

</code>

</p>


I guess the code tags are mere formalities? They don't seem to actually do anything other than point out the boundaries of where code begins, and where code ends. I will presume that you could have all of the above without the code tags?

mindlessLemming
10-24-2004, 12:08 AM
I guess the code tags are mere formalities? They don't seem to actually do anything other than point out the boundaries of where code begins, and where code ends.
Noooo! Semantic structure is not a formality!!!
This is what the whole push towards xhtml/css/no-presentational mark-up is all about -- mark-up that describes its content. The content IS code; therefore it is imperitive that you mark it up as such. Code is usually preformatted text, but so is a poem or anything else that relies on line breaks.
Use the code tags, not because they 'do anything', but because you are adding a clearer semantic structure to your content.

brothercake
10-24-2004, 09:11 AM
Exactly :)

codegoboom
10-24-2004, 09:33 AM
Also, <code> content is usu. rendered in a different font (IE=plain text; Moz=monospace; etc.), so there's one thing...

Puffin the Erb
10-24-2004, 11:56 AM
Just to echo some of the above, using tags such as <code>, <acronym> and <var> to describe content is the way to go. The visual formatting effect is a by-product that the browser may apply, but you can't take this behaviour for granted.
User agents aimed at those with impairments, such as text browsers and screen and braille readers, can use phrase elements,like the above, to describe the content of your pages in a meaningful way.
Use CSS to make the content pretty, avoid font-style tags such as <font>, <b> and <i> as they add nothing to the meaning of your content.

llizard
10-24-2004, 03:32 PM
Use CSS to make the content pretty, avoid font-style tags such as <font>, <b> and <i> as they add nothing to the meaning of your content.

Absolutely avoid <font> but I'm not so sure that I agree with the avoidance of <b> and <i> as well. While it's true that they don't really add to the meaning of the content, if used judiciously, they can be used to clarify meaning.

When setting up a new page, one of the things that I try to remember to do is to look at it with styles disabled to ensure that the content still makes some sort of sense. For a tutorial showing coding, I like to use <b> or <i> to highlight what parts of code one is to look for specifically.

Thank you, SpiritualStorms. You're very kind. I'm glad the layout of the tutorial I wrote works for you. :) Some of that CSS coding might be extraneous - I am still in the earlier stages with CSS. But, as has been mentioned already, the <code> tag itself is absolutely essential there simply because it is surrounding examples of code.

Puffin the Erb
10-24-2004, 05:49 PM
Hi again.

Replace <i> with <em> (emphasis)
Replace <b> with <strong> (strong emphasis)

This way you will keep your visual formatting effects and satisfy non-visual browsers.
For example, a speaking browser cannot speak in italic but it can emphasise the sound of the voice.
( <i> and <b> originate from word processing and, therefore, best for visual text display only)

Apply the bold and italic styles to any text using css :

.bold {font-weight:bold;}
.italic {font-style:italic;}

Reference them from your html using the class attribute :

The last word is <span class="bold">bold</span>
<br>
The last word is <span class="italic">italic</span>

Basscyst
10-24-2004, 06:21 PM
Looks like puff, didn't puff too much, because he is spot on. :thumbsup:

Basscyst

llizard
10-25-2004, 01:06 AM
Replace <i> with <em> (emphasis)
Replace <b> with <strong> (strong emphasis)


I stand corrected.

I will try to remember to make those changes in any places that bold or italic text is used for clarification of content meaning. Thanks, Puffin.

SpiritualStorms
10-25-2004, 02:38 AM
from Puffin the erb:

Just to echo some of the above, using tags such as <code>, <acronym> and <var> to describe content is the way to go. The visual formatting effect is a by-product that the browser may apply, but you can't take this behaviour for granted.
User agents aimed at those with impairments, such as text browsers and screen and braille readers, can use phrase elements,like the above, to describe the content of your pages in a meaningful way.
Use CSS to make the content pretty, avoid font-style tags such as <font>, <b> and <i> as they add nothing to the meaning of your content.

Actually, i have excluded the use of the code tags, and things are ok. The only problem i had with the useage of a text field for the containment of code display was the fact that i still had to escape the closing text field tag. I found this odd really. So i really do not know what to think ultimately of much that has been posted on here.

At any rate, i found the text fields a rather instrumental piece of trickery, really. I find them almost better than the useage of the div tags for a block effect. By connecting a text field to a CSS definition, you can actually make things a bit more presentable to the eye.

Here's an example of code:


<p>
<TextArea cols=40 rows=10 class="definitionName">
<table>
<tr>
<td>

</td>
</tr>

</table>
</TextArea>
</p>


I did the above without any actual useage of the code tags, or any of the other tags suggested. But the above does not show the escape keys necessary for the escaping of the desired tag symbol.


<p>
<TextArea cols=40 rows=8 class="definitionName">
<TextArea>


&lt;/TextArea&gt;
</TextArea>

</p>


See how i couldn't just use the closing text field tag without having to capitalise on the aid of the escape code?

At any rate, here is the definition of the term:


<style type="text/css">
<!--

body {scrollbar-3dlight-color:green;
scrollbar-arrow-color:red;
scrollbar-base-color:orange;
scrollbar-darkshadow-color:purple;
scrollbar-face-color:navy;
scrollbar-highlight-color:teal;
scrollbar-shadow-color:white}

.definitionName {background-color:CCCC33; padding:20px;}

-->
</style>

The scroll definition was something thrown in accidantally.

At any rate, i didnt use the code tags, and it seems to work ok.

mindlessLemming
10-25-2004, 09:42 AM
You really should be making all your markup lower case - definitely NOT CamelCase! :eek:



I did the above without any actual useage of the code tags, or any of the other tags suggested.
<sarcasm>
Fantastic, you've managed to strip all semantic meaning from your document. You should be very proud. :(
</sarcasm>

SpiritualStorms
10-25-2004, 11:03 AM
<sarcasm>
Fantastic, you've managed to strip all semantic meaning from your document. You should be very proud.
</sarcasm>


Hey, alright. LOL. So do i get a cookie?

llizard
10-25-2004, 03:38 PM
At any rate, i didnt use the code tags, and it seems to work ok.

It seems to work okay in IE? What about other browsers? Your coding does not validate and so it very well may look ENTIRELY different in different browsers.

Try this:


[...]
<style type="text/css">
<!--
body {background: #fff; color:#000;}

/* note that scrollbar colours will only show up in IE */
.coding {
background:#cc3; color: #000;
padding:20px;
width:300px; height:150px;
overflow:auto;
border:2px inset;
scrollbar-3dlight-color:green;
scrollbar-arrow-color:red;
scrollbar-base-color:orange;
scrollbar-darkshadow-color:purple;
scrollbar-face-color:navy;
scrollbar-highlight-color:teal;
scrollbar-shadow-color:white }

/* for IE width because IE renders box dimentions differently from other browsers */
*html .coding{width:345px; height:175px;}
-->
</style>
</head>
<body>

code:
<pre class="coding"><code title="coding">&lt;table&gt;
&lt;tr&gt;
&lt;td&gt;

&lt;/td&gt;
&lt;/tr&gt;

&lt;/table&gt;</code></pre>

[...]

This way, all visitors (including those who are blind) will still be able to tell which aspects of your page are examples of code. And because character entities have been used, it will be displayed roughly the same in all browsers.

SpiritualStorms
10-25-2004, 08:18 PM
No offense, but what yu suggest above totally defeats my preferences. I like the text field tag as a means of containing escaped code symbols. Your way simply forces me to use the greater-than, and less-than escape code, which for whatever reasons, i find infinitely irritating.


This way, all visitors (including those who are blind) will still be able to tell which aspects of your page are examples of code. And because character entities have been used, it will be displayed roughly the same in all browsers.

And yes, i was aware of how the scroll bar definitions was only applicable to IE, and not necessarily to any of the other browsers.

AaronW
10-25-2004, 08:40 PM
Using character entities is the way to do it. If you don't like typing them, use either Javascript or preferably a server-side language to have it automate it for you.

PHP has a function for it:



<?=htmlspecialchars (<<<CODE
<p>This is my HTML code sample of a paragraph.</p>
<table>
<tr>
<td>This is a single-cell table.</td>
</tr>
</table>
CODE
)?>

SpiritualStorms
10-25-2004, 08:47 PM
I was reading in another thread, and i came accross this interesting little link:

http://www.simplebits.com/cgi-bin/simplecode.pl?mode=process

I got the above from:

http://www.simplebits.com/publications/software/

The program is done in Perl though.

Willy Duitt
10-25-2004, 09:38 PM
Here's a javascript one....

codegoboom
10-25-2004, 10:25 PM
IE can do it in one step... :cool:

<textarea cols="40" rows="20" onpaste="setTimeout(function(){value=innerHTML}, 500)"></textarea>

llizard
10-25-2004, 10:54 PM
No offense, but what yu suggest above totally defeats my preferences. I like the text field tag as a means of containing escaped code symbols. Your way simply forces me to use the greater-than, and less-than escape code, which for whatever reasons, i find infinitely irritating.

No offense taken. All I'm trying to convey is that your preferences mean little to many machines and your unwillingness to use character entities may well cause your page to look like dog's breakfast on other peoples' browsers. By a miracle, your version of IE might be rendering your code as you expect it to. But you have very little guarantee that other browser versions (including the same version of IE on a different OS than yours) will produce even roughly the same thing.

Irritating or not, what must be remembered is that the characters <, > , & are integral to HTML code itself and that is why character entities should be used when displaying those characters in HTML. After all, it's a machine, not a person, that is interpreting the code. Machines might seem to be intuitive but really, let's face it; they are not.

]|V|[agnus
10-25-2004, 11:20 PM
My roommate recently scored an amazing portrait of a woman done entirely in ASCII art from Goodwill. Framed and everything. It's quite beautiful.

doggo18
10-26-2004, 05:39 PM
No offense, but what yu suggest above totally defeats my preferences. I like the text field tag as a means of containing escaped code symbols. Your way simply forces me to use the greater-than, and less-than escape code, which for whatever reasons, i find infinitely irritating.

well i findz it xtrmly anoying to typ much too. or use caps ones in a while. but that doesnt matter.. i want it that way. AND NOOBOOODY CHNG TH4T!

That is your opinion in this case, put in another context (and maybe a bit exaggurated ;)). If you would write your letters in that kind of language, no way you would ever get a job, even if it was ever understood. There are rules and restrictions, and you will have to learn to live by them. The company you wish to work for is expected to write nice letters, and when you have to write them, you better show them how :)

I will apply the same theory to the world of semantical code and make-up. Here too are rules. Those rules (in XHTML anyway) tell you, that for clearity all tags should be lowercase. Also does it say, that if for any reason you need a character that would be interpreted wrongly, you should use character entities. And that a document should identify what language it's written in (=DOCTYPE). This language again, has rules of it's own. Those rules describe how to say what things. While one thing might be said one way in XHTML, it's said totally different in HTML. With or without closing tag /.

Any language has a meaning to it... in english, a denial (not) usually follows the first verb of do/have (don't pin me on this, I am not english myself :D). A sentence like "I did that not." might be a literal translation of dutch, but that doesn't make it proper english. Many would understand, but maybe some people wouldn't. Correct english would be: "I didn't do that.".

So if the language tells you to use paragraphs in divisions, you shouldn't just leave them out because it's easier. It might be taken a whole other way, depending on the reader (=browser). And some readers, or companies in the human example above, might be a bit dyslectic and more forgiving.... and give you a second chance. That persons name is IE. But then again... Mr. Internet Explorer isn't the smartest around either. :D

This is not meant to insult anyone in any way. I was just hoping to make a comparison to something that annoys me alot in daily life :)

SpiritualStorms
10-26-2004, 10:46 PM
from doggo18:

This is not meant to insult anyone in any way. I was just hoping to make a comparison to something that annoys me alot in daily life

Uuuuummmmmhhhh...Rules eh? And tell me, of all the rules that are supposed to govern the protocal of any given process, or goal, which of any given set does one turn to, when the rule is a matter of choice, and/or of taste? Society has it's rules, and so does the heart. But what happens when the heart is in direct conflict with society? But more importantly, what happens when society itself is in conflict? Society says there's a Bible, and that we are to believe all that it professes. Society however also says, that there are rules in society, and we call them laws, and that you ought to pay attention to them as well. What then shall one do, when one side of society says, "Thou shalt not kill", while another part of society says, "Go to war, or you will go to prison"?

I like to more or less compare the above to the suggestion made (directly, or indirectly) that there might actually be several ways of doing the same thing. Someone did suggest that i could use the text field tags as the medium by which i could present code. This being the case, i took the ball (as it were), and ran with it. I create a tutorial page just so that i could test, see, and use, the text field tags. Once i saw that the result was achieved, i merely reported my observation. It is from this point forward that i have gotten a lot of commentary thereby.

At any hoo hoo, i am not totally primed on what in fact is the absolute manner in which i ought, and ought not, to do escaping of code.

Here's one example:



<pre class="coding"><code title="coding">&lt;table&gt;
&lt;tr&gt;
&lt;td&gt;

&lt;/td&gt;
&lt;/tr&gt;

&lt;/table&gt;</code></pre>


Here's example #2:


<code title="coding">&lt;table&gt;
&lt;tr&gt;
&lt;td&gt;

&lt;/td&gt;
&lt;/tr&gt;

&lt;/table&gt;</code>


And this is example #3:


<textArea><code title="coding">&lt;table&gt;
&lt;tr&gt;
&lt;td&gt;

&lt;/td&gt;
&lt;/tr&gt;

&lt;/table&gt;</code></textArea>


And here in example #4, we have only the text field tag, without the escaping code:


<textArea>
<table>
<tr>
<td>

</td>
</tr>;

</table>
</textArea>


Which of the above is really the most appropriate? I had used (for the most part) the last one, since it seemed to have worked for a few tags. The only problem with the last one is that if you are doing a toturial on the text field tags themselves, that you will be forced to use what are called the chevrons (in other words, the greater-than, and less-than signs). But over, and beyond that, i did not use the chevrons, or the pre tags, or the code tags to do any examples of a particular tag code in my tutorial. This is why i am a bit perplexed since some seemed to have some preferences for doing the same thing.

And may the game resume. Kick away gentlemen.

liorean
10-27-2004, 12:02 AM
Well, there are three ways for representing textual <, > or & in HTML according to the specification. Those are:
- CDATA blocks (SGML/XML but not well supported by tag soup parsers)
- Character or entity references (SGML or HTML/XML/tag soup)
- Rendered elements with CDATA content. (XMP, LISTING and PLAINTEXT elements in HTML2.0 and HTML3.0, deprecated HTML3.2, removed HTML4.0)

You have further the inconsistent tag soup handling. Not all HTML browsers support tags inside textarea elements, and when they do they do it differently.

In short, your only really well supported way of representing <, > or & is entity references.

SpiritualStorms
10-27-2004, 12:18 AM
Well, there are three ways for representing textual <, > or & in HTML according to the specification. Those are:
- CDATA blocks (SGML/XML but not well supported by tag soup parsers)
- Character or entity references (SGML or HTML/XML/tag soup)
- Rendered elements with CDATA content. (XMP, LISTING and PLAINTEXT elements in HTML2.0 and HTML3.0, deprecated HTML3.2, removed HTML4.0)

You have further the inconsistent tag soup handling. Not all HTML browsers support tags inside textarea elements, and when they do they do it differently.

In short, your only really well supported way of representing <, > or & is entity references.


YOu know, i dont question your intelligence, and your knowledge of the subject matter before us, but must you always speak in a manner that seems more than webdesign? I have a hard time with your techno-speak.

I have no idea what SGML is. And i dont usually work in XML either. Hell, i barely even know CSS. Been too focused on too many things besides the full range of webdesign. There will be many nooks, and crannies, that i will simply not be too familiar with, such as the ones mentioned, i.e. SGML, and the what not.

By entity references, i will assume you mean the actual code symbol that represents a particular English symbol?

I do not know what CDATA means.

Of the examples shown in a previous post, which, if any, comports, with the highest degree of propriety? Mind you, i am working with HTML, and not SGML, or XML, or any of the other versions of markup out there on the market.

llizard
10-27-2004, 12:19 AM
edit: Your best bet is to use Example number 1


Uuuuummmmmhhhh...Rules eh?

Well, you are a child of the universe and of course, you should do whatever it is that you want (because that's what it's all about, isn't it?) However, bear in mind that your example of code inside the text field may not be rendered by all browsers and all OS.

To reiterate one last time: the "less than" and "greater than" characters (aka "chevrons" in some parts of the universe) are integral to code itself. Some computers may misinterpret your intention and display something entirely different from what you expect. Granted, many computers will interpret it exactly as you expect. So perhaps you don't care about the percentage that simply cannot stand the idea that you wiggled out of spending so much time and energy to use character entities in place of coding characters to ensure universal display.

If you want to use the "textarea" tags instead of "pre" tags to display your examples of code, go ahead. But within those tags, it is advisable to use character entities for the < and > characters. Take a look at the source code of this page and you will see that within this paragraph, the < has been changed to &lt; (and the &lt; that I typed has been changed to &amp;lt;) You will also see that all instances of " have been changed to &quot; and & have been changed to &amp;. Why? Yup. Rules, more rules. The " and & characters are also integral to coding and might be misinterpreted by some computers.

Also note that the textarea tag requires col and row specs. Yes... more rules.

Run your page through the WDG (Web Design Group) validator at http://www.htmlhelp.org/tools/validator/ It will point out the errors of your ways. You can choose whether you will follow the suggestions or continue on your merry way.

------------------
fishing is such a great sport, isn't it?

mindlessLemming
10-27-2004, 12:42 AM
Uuuuummmmmhhhh...Rules eh? And tell me, of all the rules that are supposed to govern the protocal of any given process, or goal, which of any given set does one turn to, when the rule is a matter of choice, and/or of taste?
That's totally irrelevant. This is not a matter of choice OR taste. Despite multiple efforts by members to inform you; you insist on dragging this garbage out like there are all these alternatives that are as valid as each other.
THEY ARE NOT ALL EQUAL.

Like any spoken language, html has semantics -- the elements of the language bring with them pre-defined contextual meaning.
What are you trying to do here?
--You are displaying code as content.
What is a code sample/block?
--It is pre-formatted text.

Therefore, by using the language as it was written to be used, the correct way to include blocks of code in your content is <code> tags nested within <pre> tags.
This textarea garbage is a lazy hack for lazy developers who don't care about the code they are writting.

There's a line in the sand. Non-semantic code and presentational markup are on one side; semantic code and a more accessible web are on the other.

Where do you stand?

Kurashu
10-27-2004, 01:00 AM
What you are trying to do is disassemble (X)HTML at its core, but not use &lt; and &rt; for your < and > in your code display. ALSO, you need the code and pre tags to have valid AND semantic code. Laziness is NOT an excuse.

liorean
10-27-2004, 01:20 AM
YOu know, i dont question your intelligence, and your knowledge of the subject matter before us, but must you always speak in a manner that seems more than webdesign? I have a hard time with your techno-speak.It's not one iota more than web design - what I speak about are fundamentals.
I have no idea what SGML is. And i dont usually work in XML either. Hell, i barely even know CSS. Been too focused on too many things besides the full range of webdesign. There will be many nooks, and crannies, that i will simply not be too familiar with, such as the ones mentioned, i.e. SGML, and the what not.HTML is an SGML application - an SGML markup language. SGML governs how HTML syntax works. Understanding SGML is not a requirement for understanding HTML, but learning the rules SGML places on HTML is important for actual usage of HTML. For example, understanding content types.
By entity references, i will assume you mean the actual code symbol that represents a particular English symbol?Yes. &lt; is a reference to the lt entity, which represents the textual character '<'.
I do not know what CDATA means.I've told you earlier in the thread.
Of the examples shown in a previous post, which, if any, comports, with the highest degree of propriety?The textarea element may not contain any tags - if it does, you are making an error. This error, the browser must correct for, but there is no standard for how. For instance, some browsers would just strip out the tags and render the textual content. Some may display the source. Some may end the textarea prematurely and parse the contents of the textarea as if it were after the textarea instead of inside it. Some may simply discared all content of the textarea. All these behaviors are proprietary. On the other hand, the entity references are supported by all browsers everywhere. They are the way you should use to represent the characters that have special meaning in SGML or XML textually.
Mind you, i am working with HTML, and not SGML, or XML, or any of the other versions of markup out there on the market.You are working with HTML and thus SGML.


Anyways, listen to Andrew:
- If the content is preformatted text - in other words, if it is text where whitespace and new lines are important - you should use the pre element.
- If the content is coding you should use the code element.
- If it's a textual '<' and not the start of a tag, you should use &lt;. Analogously textual '>' should be &gt; and textual '&' should be &amp;.

SpiritualStorms
10-27-2004, 02:45 AM
MindlessLemming:

That's totally irrelevant. This is not a matter of choice OR taste. Despite multiple efforts by members to inform you; you insist on dragging this garbage out like there are all these alternatives that are as valid as each other.
THEY ARE NOT ALL EQUAL. (Emphasis added to the intended party, lol)


Huumbuglars, looky here. A huumbuglar is athrowing them rocks at the sills. Quick, call me them huuumbuglar killers.

Hey, there's plenty of beer in the juggers, man. Easy up, ole buddy, ole pal. I was merely taking this guys advise:




Another way it could be done, may not be so nice though, but it would work.

Just throw the example into a <textarea onfocus='this.blur();'><a href="http://yourURL.com">Yay</a></textarea>

Basscyst


As i said, i took his ball, and ran with it. Seemed to have given me a touch down. Thus the posting following.

No need to storm a fuzz. Fuzzy wuzzies aint no real fuzzy wuzzies. They may be a fuzzy, but not much of a wuzzy.

Ok, so pre, code, and the entity references are always needed whenever one wants to include actual code as content, and not necessarily as markup.

OK. I got that, after a few clarifications.

As to where do i stand? I stand where the big dude with the club wont be crashing my highs man. That's where i will be. Kaabish?

To sum up:



from liorean:

Anyways, listen to Andrew:
- If the content is preformatted text - in other words, if it is text where whitespace and new lines are important - you should use the pre element.
- If the content is coding you should use the code element.
- If it's a textual '<' and not the start of a tag, you should use &lt;. Analogously textual '>' should be &gt; and textual '&' should be &amp;.

chilipie
10-27-2004, 10:21 AM
Huumbuglars, looky here. A huumbuglar is athrowing them rocks at the sills. Quick, call me them huuumbuglar killers.

What the hell is a huumbuglar :confused: ?

Willy Duitt
10-27-2004, 04:57 PM
LovesWar

Sometimes I think your sig says it all...
Which in its simplist form is: an arguement for arguements sake....

SpiritualStorms
10-27-2004, 09:44 PM
from Willy:

Sometimes I think your sig says it all...
Which in its simplist form is: an arguement for arguements sake....

Oh my, arent we a cynic? Actually, my sig could mean more than one thing. I could litterally mean the war that love is in, hence loveswar, but i didnt realise i could throw in special charactor's like the single quote sign for ownership, so my sig ended up as it has. The other could be, yea, i love to war. But since debating the point would prove your contention, not sure how i would win here. Is the glass half-full? Or is it half-empty?

I love you just the same.

bradyj
10-29-2004, 12:31 AM
Cmon, this isn't the beat mystique -- drop the Kerouac, you're going to confuse the developers too much. Besides, throwing down an intellectual circle-jerk in an html forum doesn't fit with target audience. Especially in a semantics arguement about your sig.

The point of what they are explaining to you, regardless of your need to question the rules that bind your creations, is that there are methods that benefit others, and there are ones that do not. Liorean and mindlessLemming pointed out the very reasons why you should not be doing that coding practice... so what is the point then of doing it? Visual representation in Internet Explorer only? That may be alot of your sighted audience... but where does that leave everyone else?

Willy's point was not out of cynicsm -- you are playing devil's advocate for your own amusement. If there's anything left to discuss about this method, then I'd like to see us get back too it.

SpiritualStorms
10-29-2004, 03:09 AM
from Bradj:

If there's anything left to discuss about this method, then I'd like to see us get back too it.


I believe the issue had been resolved a while back. It was concluded that whether or not, i liked it, i had to use the pre, and code tags, and the chervon escape symbols if i wanted to do any actual presentation of any given tag as content. This thread should be officially closed since there hasn't been any further need to argue the propriety of certain methods, if indeed they were such, lol.

Ps: And no Brad, Willy is quiet cynical. He questions the motives with which anyone does anything. Oh well, i suppose time will do that to a man. Cant very well hold on to the Peter Pan attitude from the cradle to the grave. Sooner, or later, we are bound to be dissillusioned of something, or rather.

Thankz to all who have contributed, whether in patience, or admonishment, lol.

bradyj
10-29-2004, 04:20 AM
Ps: And no Brad...

Did you mean 'Brady'?:)

SpiritualStorms
10-29-2004, 04:30 AM
Did you mean 'Brady'?

Yes, i meant Brady.

Willy Duitt
10-29-2004, 06:49 AM
Ps: And no Brad, Willy is quiet cynical. He questions the motives with which anyone does anything.

Hmmmm;

You may be a cynic:


If you can not believe the unmitigated gall some people have by plagiarizing a script by removing the original authors credits and then ask other developers whom are freely sharing their time and whom may even know the original author to aide them in modifying said code...

If you often wonder how someone can be so selfish and disrespectful as to cross-post their questions in numerous forums and never return to update their threads to indicate a solution was found somewhere else...

If you are astonished that some people have no shame and post questions which a simple search either here on the forum or google will return the solution faster than the time they spent posting their question (for utter astonishment, also see above)....

If you find yourself astounded that a relatively simple question such as " How does one official escape tags" is correctly answered on the very next post but goes on and on for 50 more posts, and without an end in sight (for utterly astounded , also see above)....

If you find yourself pondering if it's cynical to wonder what was left unsaid when someone with a history of never following thru and completing anything calls you a cynic....


.....Willy

SpiritualStorms
10-29-2004, 07:07 AM
I sense a lot of anger. Want to go for a walk? I will let yu hold my hand?

I would certainly hope not that most of the above were directed at me. I have given credit where credit was due. So i hardly think all of your above apply to me.

As for having to carry on, after a seemly taken-care-of point, well, i wont make apologies for wanting thoroughness where i felt none existed.

As for not saying thankz, that there too, is not related to me, for i have said thankz numerous times.

You know, i so search engine a lot, believe it or not. In fact, i feel that my transcends of the speed of light have actually allowed me to evolve to the point where a new hand has been growing out of my forehead for quite sometime. Dont tell anybody though, last thing i need is to be a test study at some scientific lab. As if i dont have enough problems already just trying to brush my teethe. Dont know if i could handle a bunch of strangers poking me, and things, especially, if i dont get a cookie, and a movie out of it.

As for your last point in your well organised anger dis-charge (and i mean no play on words here, honestly, lol), i would say, "I have no idea what you are talking about!"

You know your a cynic. Why make a fuzz over it?

And if i recall correctly, i tried sending you a PM, and well, you never got back, so thats one example of someone not following through.

AaronW
10-29-2004, 01:31 PM
You may be a cynic if you believe everyone else is a cynic...

Cynic is actually my usual Web alias. It's such a cool word.

gsnedders
10-29-2004, 04:07 PM
That's made my day... After having my G5 taken away as dead on arrival.

sage45
10-29-2004, 08:04 PM
Closing thread... Purpose served...

-sage-



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum