-
<static> cloneObject(_obj)
-
深度克隆对象, 使用 JSON.stringify
Parameters:
Name |
Type |
Description |
_obj |
Object
|
|
- Source:
-
Returns:
Object
-
<static> detectCommand(_cmd)
-
从字符串解析变量值
变量值层级关系以 "." 为分隔
根变量必须为 window
Parameters:
Name |
Type |
Description |
_cmd |
string
|
|
- Source:
-
Returns:
string
-
-
格式化日期为 YYYY-m-d 格式
require: pad\_char\_f
Parameters:
Name |
Type |
Description |
_date |
date
|
要格式化日期的日期对象 |
_split |
string
|
undefined
|
定义年月日的分隔符, 默认为 '-' |
- Source:
-
Returns:
string
-
<static> getMobileOperatingSystem()
-
Determine the mobile operating system.
This function either returns 'iOS', 'Android' or 'unknown'
- Source:
-
Returns:
-
Type
-
String
-
<static> getNumberValue(_v)
-
获取数值的值, 如果为空返回 '-'
Parameters:
Name |
Type |
Description |
_v |
*
|
|
- Source:
-
Returns:
-
Type
-
String
|
Number
-
<static> getStringValue(_v)
-
获取字符串的值, 如果为空返回 '-'
Parameters:
Name |
Type |
Description |
_v |
*
|
|
- Source:
-
Returns:
-
Type
-
String
-
<static> isDecimal(_n)
-
判断数值是否为十进制
Parameters:
Name |
Type |
Description |
_n |
number
|
|
- Source:
-
Returns:
Boolean
-
<static> isMoney(_n, _dot)
-
判断数值是否为金额
Parameters:
Name |
Type |
Description |
_n |
number
|
|
_dot |
int
|
浮点数长度 |
- Source:
-
Returns:
Boolean
-
<static> padChar(_str, _len, _char)
-
js 附加字串函数
Parameters:
Name |
Type |
Description |
_str |
string
|
|
_len |
intl
|
|
_char |
string
|
|
- Source:
-
Returns:
string
-
<static> parentSelector(_item, _selector, _finder)
-
扩展 jquery 选择器
扩展起始字符的 '/' 符号为 jquery 父节点选择器
扩展起始字符的 '|' 符号为 jquery 子节点选择器
扩展起始字符的 '(' 符号为 jquery 父节点查找识别符
Parameters:
Name |
Type |
Description |
_item |
selector
|
|
_selector |
String
|
|
_finder |
selector
|
|
- Source:
-
Returns:
selector
-
<static> parseBool(_in)
-
把输入值转换为布尔值
Parameters:
Name |
Type |
Description |
_in |
*
|
|
- Source:
-
Returns:
bool
-
<static> parseFinance(_i, _dot)
-
取小数点的N位
JS 解析 浮点数的时候,经常出现各种不可预知情况,这个函数就是为了解决这个问题
Parameters:
Name |
Type |
Description |
_i |
number
|
|
_dot |
int
|
default = 2 |
- Source:
-
Returns:
number
-
<static> printf(_str)
-
按格式输出字符串
Parameters:
Name |
Type |
Description |
_str |
string
|
|
- Source:
-
Returns:
string
Example
printf( 'asdfasdf{0}sdfasdf{1}', '000', 1111 );
//return asdfasdf000sdfasdf1111
-
<static> printKey(_str, _keys)
-
按格式输出字符串
Parameters:
Name |
Type |
Description |
_str |
string
|
|
_keys |
object
|
|
- Source:
-
Returns:
string
Example
JC.f.printKey( 'asdfasdf{key1}sdfasdf{key2},{0}', { 'key1': '000', 'key2': 1111, '0': 222 );
//return asdfasdf000sdfasdf1111,222