Welcome Guest ( Log In | Register )



3 Pages V   1 2 3 >  
Reply to this topicStart new topic
> disable html tags
kilz
post Oct 19 2004, 12:34 PM
Post #1


Member [ Level 2 ]
Group Icon

Group: [HOSTED]
Posts: 52
Joined: 5-September 04
Member No.: 256



hello
how do i disable html tags in a part of html page??
Go to the top of the page
 
+Quote Post
lhunath
post Oct 19 2004, 12:39 PM
Post #2


Premium Member
Group Icon

Group: [HOSTED]
Posts: 224
Joined: 13-October 04
From: Belgium
Member No.: 1,160



HTML
<pre>
<p>lalalalalal</p>
</pre>

will show:
<p>lalalalalal</p>
rather than:
lalalalalal

I think that's what you need?
Go to the top of the page
 
+Quote Post
kilz
post Oct 19 2004, 01:48 PM
Post #3


Member [ Level 2 ]
Group Icon

Group: [HOSTED]
Posts: 52
Joined: 5-September 04
Member No.: 256



I want to display the html code, also disable their function.
for example:
if I type: <b>fjdsgfjds</b>
output = fjdsgfjds
!= fjdsgfjds

but I don't want any php or javascript code. . .
Go to the top of the page
 
+Quote Post
marijnnn
post Oct 19 2004, 06:47 PM
Post #4


Premium Member
Group Icon

Group: [HOSTED]
Posts: 336
Joined: 22-September 04
Member No.: 798



then, there's no such thing. you'll have to use either a client or server side script. i'd advise php, because then your output doens't depend on the client having javascript enabled or not. but javascript is probably the easiest.

http://www.webdevtips.com/webdevtips/js/striptag.shtml

that should help you out

but i'd still advise you to use php though, or another serverside script.
+ i don't really get the use but whatever

Go to the top of the page
 
+Quote Post
lhunath
post Oct 19 2004, 11:20 PM
Post #5


Premium Member
Group Icon

Group: [HOSTED]
Posts: 224
Joined: 13-October 04
From: Belgium
Member No.: 1,160



QUOTE(kilz @ Oct 19 2004, 03:48 PM)
I want to display the html code, also disable their function.
for example:
if I type: <b>fjdsgfjds</b>
output = fjdsgfjds
!= fjdsgfjds

but I don't want any php or javascript code. . .
*


How does that display the html code...? :/
Go to the top of the page
 
+Quote Post
r3d
post Oct 20 2004, 03:06 AM
Post #6


death
Group Icon

Group: Members
Posts: 268
Joined: 8-September 04
Member No.: 384



save your file as text, the server wont parse that as html.
also try "&lt;" it will show < and "&gt;" show > in html.
for example.
&lt;B&gt; This is not bold &lt;/B&gt;
output:
<B>This is not bold</B>

hope that helps
Go to the top of the page
 
+Quote Post
kilz
post Oct 20 2004, 05:16 AM
Post #7


Member [ Level 2 ]
Group Icon

Group: [HOSTED]
Posts: 52
Joined: 5-September 04
Member No.: 256



QUOTE
How does that display the html code...? :/

sorry, it should be: <b>fjdsgfjds</b>

QUOTE
save your file as text, the server wont parse that as html.
also try "&lt;" it will show < and "&gt;" show > in html.
for example.
&lt;B&gt; This is not bold &lt;/B&gt;
output:
<B>This is not bold</B>

hope that helps

thanks a lot, but please tell what it means, &lt; &gt;
are they ascii code of < and >??

-------------
in php, we can use htmlspecialchars() to display and disable html.
in javascript, how??
I would like to create some html tutorial for my site, so disable them.
Go to the top of the page
 
+Quote Post
marijnnn
post Oct 20 2004, 06:42 AM
Post #8


Premium Member
Group Icon

Group: [HOSTED]
Posts: 336
Joined: 22-September 04
Member No.: 798



ok, i really don't get your question anymore, but whatever:
normal situation:
if your code is: <b>bold</b>
they will see bold
1. if you want the users to see your html code instead of the effect it has, use <pre>

your code: <b>bold</b>
on their screen: <b>bold</b>

another option to do this is the way r3d described: you use the html special characters instead of the real character.
you can make a javascript function that replaces every "<" by "&lt;", every
">" by "&gt;" etc

2. if you want to strip all the tags:
your code: <b>bold</b>
they see: bold

what you need to do is strip the html tags
so wherever you find something like <xxx> (regular expression: /<[^>]*>/) replace it by an empty string.


if this still doesn't help you, please tell us which one of these two things you want.
Go to the top of the page
 
+Quote Post
kilz
post Oct 20 2004, 11:55 AM
Post #9


Member [ Level 2 ]
Group Icon

Group: [HOSTED]
Posts: 52
Joined: 5-September 04
Member No.: 256



it helps a lot
thanks a lot. . .biggrin.gif
Go to the top of the page
 
+Quote Post
marijnnn
post Oct 20 2004, 12:05 PM
Post #10


Premium Member
Group Icon

Group: [HOSTED]
Posts: 336
Joined: 22-September 04
Member No.: 798



glad to be at your service smile.gif
Go to the top of the page
 
+Quote Post

3 Pages V   1 2 3 >
Reply to this topicStart new topic

Collapse

> Similar Topics

Topics Topics
  1. Basic Tips and Tricks in HTML(15)
  2. Embedding XML into HTML(2)
  3. Div Tags Vs Tables For Layout(10)
  4. Force Object To Load Last(2)
  5. Free Shoutbox? HTML, Flash or PHP Code(24)
  6. Here Are Some Html Tutorial Sites(1)
  7. Get Input From Html/txt File?(2)
  8. How Can You Spice Up Your Basic HTML Site ? Beginner Needs Help(9)
  9. HTML Editor(23)
  10. Need Help With The HTML HR Tag(5)
  11. HTML: Seems Like A Simple Problem, But I'm Baffled!(4)
  12. Where To Find A WML To HTML Converter ?(2)
  13. A First Peep Into Html(5)
  14. Home Videos(4)
  15. Bulletproof HTML: 37 Steps To Perfect Markup(4)
  1. Quick Tips On Html And Css(11)
  2. Firefox Inventing Its Own Html?(9)
  3. Scripts And Html(13)
  4. Stretching My Site Vertically(6)
  5. Html Stats(3)
  6. About Html(15)
  7. Html Table Issue.(18)
  8. Html Emails How?(12)
  9. Sitepoint's Css And Html Reference Sites(2)
  10. Yaml - (x)html/css Framework(2)
  11. Style P And H? Html Tags(2)
  12. Indentation In Html(4)
  13. Good Books For Html And Css Beginners(1)


 



- Lo-Fi Version Time is now: 12th October 2008 - 02:43 PM