TFW's Web Base / Javascript Samples: Misc Tricks
Page: [tfw/base/04_javascript/samples/01_misc_tricks.html] (v2015-08-15_01-40.victory_day)
Self-exam:
../js/misc.js
[View >>]
javascript_function();
Type judgment:
function isArray(obj) {...}
function isDom(obj) {...}
function isDate(obj) {...}
function isFunction(obj) {...}
function isNumber(obj) {...}
function isText(obj) {...}
function isConstructedAsObject(obj) {...}
Type convertion:
function o2s(obj, strNullReplacement) {...}
function o2i(obj, intReplacement) {...}
function o2f(obj, intReplacement) {...}
DOM value(s) and contents assignment:
function fillElement(domElement, objContents) {...}
- Select -
0: root
1: admin
2: mgr
3: eng
4: custom
root
admin
mgr
eng
custom
Nothing.
Text manipulation:
calculateByteLength('
');
Return:
(int)
encodeURI_('
');
Return:
(string)
encodeURIComponent_('
');
Return:
(string)
escape_('
');
Return:
(string)
trim('
');
Return:
(string)
trimLeft('
');
Return:
(string)
trimRight('
');
Return:
(string)