2 Replies - 1633 Views - Last Post: 21 July 2010 - 08:36 AM Rate Topic: -----

#1 mpryan73  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 39
  • Joined: 05-February 10

Output actual HTML

Posted 21 July 2010 - 06:10 AM

I think I've seen somewhere how you can output the actual code instead of rendering it with coldfusion but can't seem to find it. Is this possible?
Is This A Good Question/Topic? 0
  • +

Replies To: Output actual HTML

#2 Craig328  Icon User is offline

  • I make this look good
  • member icon

Reputation: 1912
  • View blog
  • Posts: 3,442
  • Joined: 13-January 08

Re: Output actual HTML

Posted 21 July 2010 - 06:22 AM

Well, the trick is that HTML doesn't get rendered by the Coldfusion engine at all. HTML output to a browser has the browser interpreting the HTML tags and rendering them.

In order to get around that you'll want to replace the left and right greater than/less than signs (sorry, I don't recall the proper names for those characters) with their ASCII equivalents. That is, for "<" you'd use "&lt;" for ">" you'd use "&gt;". What you'll use CF for is to build a function that you can call and pass a string to that will parse through the passed string replacing the lesser and greater than signs with their ASCII equivalents and pass back the edited string for you to display.

I believe this function found on CFLib.org does it all for you.

Good luck!
Was This Post Helpful? 0
  • +
  • -

#3 mpryan73  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 39
  • Joined: 05-February 10

Re: Output actual HTML

Posted 21 July 2010 - 08:36 AM

Works great thanks
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1