example10_esc - escaping text strings - using funcyTag.esc() for strings that may contain html characters



show FuncyTag html string output

show Javascript source code

To Notice: It is common to output and embed javascript strings with FuncyTag, but if you don't know the source of that string it could contain html codes or injecting scripting codes that could be a problem. The funcyTag.esc()method can be used to inject strings into HTML safely whenever there is a potential that those strings could contain problem characters. In the above example, funcyTag.esc() was used twice with these statements:
funcyTag.esc(' a<b>c')
funcyTag.esc('"dog" & "pony"')

next: example11_simple_events top: all js examples