NetTalk Central

NetTalk Web Server => Web Server - Ask For Help => Topic started by: Rob Kolanko on April 08, 2013, 01:27:20 PM

Title: Accidental HTML
Post by: Rob Kolanko on April 08, 2013, 01:27:20 PM
Hi
I have plain text from a database field that I wish to insert HTML within the text for display purposes. Before I do that, I will need to translate the plain text to convert any accidental HTML ( e.g. '< ', accented characters, etc) in the text to show as the intended on the web page. Is there a web handler method (p_web) that will return a converted string to view as is on a web page?  then I will add my HTML to be displayed on a Display field that allows HTML.

Thanks Rob
Title: Re: Accidental HTML
Post by: Bruce on April 08, 2013, 08:15:11 PM
there is indeed.
the WebServer ._jsok method does this.
The easiest way to call this though is via the .Translate method.
ie

whatever = p_web.Translate(whatever)

that takes care of some internal machinations that must occur.

Cheers
Bruce