lazyj.page.tags
Class JS

java.lang.Object
  extended by lazyj.page.tags.JS
All Implemented Interfaces:
StringFormat

public final class JS
extends java.lang.Object
implements StringFormat

js tag produces an JavaScript-safe encoding of the value.

Since:
2006-10-13
Author:
costing
See Also:
Enc, Esc

Constructor Summary
JS()
           
 
Method Summary
 java.lang.String format(java.lang.String sTag, java.lang.String sOption, java.lang.String s)
          Make a string usable in a JS script, as a string value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JS

public JS()
Method Detail

format

public java.lang.String format(java.lang.String sTag,
                               java.lang.String sOption,
                               java.lang.String s)
Make a string usable in a JS script, as a string value. Use this when you are about to initialize a string in a JS with a value that might contain special characters.

Specified by:
format in interface StringFormat
Parameters:
sTag - tag name, ignored
sOption - always "js"
s - value to transform
Returns:
js-safe representation
See Also:
Format.escJS(String)