/** * Returns a quoted string usable as javascipt variable * @param string $string * @param boolean $htmlEncode True if shall be hmtl encoded before */ function JsVarOut($string, $htmlEncode = false) { echo String::ToJavascript($string, $htmlEncode); }
/** * Sets element html content as a typical action of a modal form call * @param string $element The element specifier; typically starting with '#' * @param string $html The html string */ protected function SetJSHtml($element, $html) { $jsElement = String::ToJavascript($element, false); $jsHtml = String::ToJavascript($html, false); echo "<script>\$({$jsElement}).html({$jsHtml});</script>"; }