sxdcgaq8080

 

今日份代码:

        isJSON: function(str) {
            if (typeof str == \'string\') {
                try {
                    var obj=JSON.parse(str);
                    if(typeof obj == \'object\' && obj ){
                        return true;
                    }else{
                        return false;
                    }

                } catch(e) {
                    return false;
                }
            }else if (typeof str == \'object\'  && str) {
                return true;
            }
        },

 

分类:

技术点:

相关文章:

  • 2021-10-08
  • 2021-09-29
  • 2022-12-23
  • 2021-12-04
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-10
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-06-07
  • 2022-12-23
  • 2021-06-21
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案