htmlHelper::jsTools PHP Method

jsTools() public method

This method will only operate from the first occurrence in your code, subsequent calls will not output anything but you should add it anyway as it will make sure that your code continues to work if you later remove a previous call to jsTools. Tools provided: dom() method is a direct replacement for document.getElementById() that works in all JS-capable browsers Y2k and newer. vork object - defines a global vork storage space; use by appending your own properties, eg.: vork.widgetCount
public jsTools ( boolean $noJsWrapper = false ) : string
$noJsWrapper boolean set to True if calling from within a $html->jsInline() wrapper
return string
    public function jsTools($noJsWrapper = false)
    {
        return $this->jsInlineSingleton("var vork = function() {}\r\nvar dom = function(id) {\r\n    if (typeof document.getElementById != 'undefined') {\r\n        dom = function(id) {return document.getElementById(id);}\r\n    } else if (typeof document.all != 'undefined') {\r\n        dom = function(id) {return document.all[id];}\r\n    } else {\r\n        return false;\r\n    }\r\n    return dom(id);\r\n}", $noJsWrapper);
    }