|
|
|
|
![]() ![]() |
Oct 19 2004, 12:34 PM
Post
#1
|
|
|
Member [ Level 2 ] Group: [HOSTED] Posts: 52 Joined: 5-September 04 Member No.: 256 |
hello
how do i disable html tags in a part of html page?? |
|
|
|
Oct 19 2004, 12:39 PM
Post
#2
|
|
|
Premium Member 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? |
|
|
|
Oct 19 2004, 01:48 PM
Post
#3
|
|
|
Member [ Level 2 ] 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. . . |
|
|
|
Oct 19 2004, 06:47 PM
Post
#4
|
|
|
Premium Member 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 |
|
|
|
Oct 19 2004, 11:20 PM
Post
#5
|
|
|
Premium Member Group: [HOSTED] Posts: 224 Joined: 13-October 04 From: Belgium Member No.: 1,160 |
|
|
|
|
Oct 20 2004, 03:06 AM
Post
#6
|
|
|
death 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 "<" it will show < and ">" show > in html. for example. <B> This is not bold </B> output: <B>This is not bold</B> hope that helps |
|
|
|
Oct 20 2004, 05:16 AM
Post
#7
|
|
|
Member [ Level 2 ] 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 "<" it will show < and ">" show > in html. for example. <B> This is not bold </B> output: <B>This is not bold</B> hope that helps thanks a lot, but please tell what it means, < > 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. |
|
|
|
Oct 20 2004, 06:42 AM
Post
#8
|
|
|
Premium Member 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 "<", every ">" by ">" 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. |
|
|
|
Oct 20 2004, 11:55 AM
Post
#9
|
|
|
Member [ Level 2 ] Group: [HOSTED] Posts: 52 Joined: 5-September 04 Member No.: 256 |
it helps a lot
thanks a lot. . . |
|
|
|
Oct 20 2004, 12:05 PM
Post
#10
|
|
|
Premium Member Group: [HOSTED] Posts: 336 Joined: 22-September 04 Member No.: 798 |
glad to be at your service
|
|
|
|
![]() ![]() |
Similar Topics
|
Lo-Fi Version | Time is now: 12th October 2008 - 02:43 PM |