var m ={a:'A'}; if(typeof m == 'object' && JSON.stringify(m).indexOf('{') == 0){//判断变量m是不是json对象 console.log('m is json');} JSON.stringify():这个函数可以将json对象和数组转换为字符串类型. eval():这个方法可以将json字符串和数组字符串转换为json对象和数组对象 eval('('+json_arr_str+'
第一种代码:EXFCODE:1 function isChinese(temp)2 {3 var re=/[^/u4e00-/u9fa5]/;4 if (re.test(temp)) return false ;5 return true ;6 } 第二种代码:EXFCODE:01 function isChn(str)02 {03 var reg=/^[/u4E00-/u9FA5]+$/;04
Roman numerals are represented by seven different symbols: I, V, X, L, C, D and M. Symbol Value I 1 V 5 X 10 L 50 C 100 D 500 M 1000 For example, two is written as II in Roman numeral, just two one's added together. Twelve is written as, XII, which i