up: ZUT     index Zimbu documentation

CLASS ZUT.Javascript EXTENDS ZUT.Base @public

summary

     

A string that is properly formatted Javascript.

This is used to ensure proper Javascript escaping.

$add(js) ZUT.Base @public  Add js to the Javascript, it will be escaped as needed.
$add(js) ZUT.Javascript @public  Add js to the Javascript, it will be added as-is.
 
fromSafeString(safeContent) ZUT.Javascript @public  Create a ZUT.Javascript object from a string that contains safe, already escaped Javascript.
toSafeString(js) string @public  Inside a script tag, escape a string.
toSafeString(nr) string @public  Inside a script tag, add an int.
toSafeString(nr) string @public  Inside a script tag, add a float.
toSafeString(js) string @public  Inside a script tag, add Javascript directly.
 
Inherited from ZUT.Base:
NEW() @public 
$addUNESCAPED(safeContent) ZUT.Base @public  Add safeContent to the section, it will not be escaped.
$add(number) ZUT.Base @public  Add number to the item as a string.
$add(number) ZUT.Base @public  Add number to the item as a string.
$ToString() string @public  Return the concatenated result.
 

members (alphabetically)

     

FUNC $add(string js) ZUT.Base @public

     

Add js to the Javascript, it will be escaped as needed.

FUNC $add(ZUT.Javascript js) ZUT.Javascript @public

     

Add js to the Javascript, it will be added as-is.

shared (alphabetically)

     

FUNC fromSafeString(string safeContent) ZUT.Javascript @public

     

Create a ZUT.Javascript object from a string that contains safe, already escaped Javascript.

USE WITH CARE: Javascript that is not properly escaped can create an XSS vulnerability!

FUNC toSafeString(string js) string @public

     

Inside a script tag, escape a string.

FUNC toSafeString(int nr) string @public

     

Inside a script tag, add an int.

FUNC toSafeString(float nr) string @public

     

Inside a script tag, add a float.

FUNC toSafeString(ZUT.Javascript js) string @public

     

Inside a script tag, add Javascript directly.

license

      Copyright 2014 Bram Moolenaar All Rights Reserved.

      Licensed under the Apache License, Version 2.0. See the LICENSE file or obtain a copy at: http://www.apache.org/licenses/LICENSE-2.0