• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Displaying non html tags in browser

 
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi i want some help for displaying user defined tags in browser.

i have user defined tags like this <jjj>hhh</jjj><kkk>dd</kkk><b>jjj

but if i use <jjj>hhh</jjj><kkk>dd</kkk><b>jjj

they are displaying in mozilla as <jjj>hhh</jjj><kkk>dd</kkk>jjj(in bold)
as expected.
but my requirement is to display <jjj>hhh</jjj><kkk>dd</kkk> as it is
even if i don't use < and > for user defined tags i need help on this.
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You want to diplay the < and > characters on the page so it is visible to the user.

So

<foo>asdf</foo> appears as <foo>asdf</foo> and not just asdf?

If that is the case escape your < and > to ∓lt; and &gt;

Eric
 
N Naresh
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi my problem is to display <jjj>hhh</jjj> as it is in the browser
not just 'hhh' i dont want to use < > why because it is effecting in build html tags such as <b>ddd is not displaying as it is expected i cant loop through all html tags which are exists that makes my code very complicate.
 
N Naresh
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
&mplt; and > i can't use why because it effects my in build html tags
 
Sheriff
Posts: 67747
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You've posted this in multiple threads. Please stop.

The situation is as simple as this:
  • Replace angle brackets that you want to appear as-is on the display with the HTML entities &lt; and &gt;.
  • Leave anfle brackets that you want the browser to interpret as HTML alone.
  • That's all there is to it.
    [ November 06, 2008: Message edited by: Bear Bibeault ]
     
    N Naresh
    Ranch Hand
    Posts: 66
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    how we can check for all possible html tags in that string?
     
    Bear Bibeault
    Sheriff
    Posts: 67747
    173
    Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    As was pointed out in another thread, if you are using JSP, you don't have to. Use <c ut> to emit any text that contains characters that need to be converted.
     
    reply
      Bookmark Topic Watch Topic
    • New Topic