1. 程式人生 > >Extjs 判斷對象是非為null或者為空字符串

Extjs 判斷對象是非為null或者為空字符串

define tex The nbsp fine mce ali 空字符串 isempty

Ext.isEmpty(str,[allowEmptyString])

如果str為

  • null
  • undefined
  • a zero-length array
  • a zero-length string (??? Unless the allowEmptyString parameter is set to true)//意思如果第二個參數設為true,則是允許str對象為空字符串

該方法返回true

如果不為上面條件則返回false

Extjs 判斷對象是非為null或者為空字符串