Javascript 无法使用JSON对象

Javascript 无法使用JSON对象,javascript,jquery,foreach,Javascript,Jquery,Foreach,我有一个JSON对象,看起来与 { "mydata":[ "one", "two", "three" ], "outside":[ { "vals":["four", "five", "six"], "soso":{"seven", "eight", "nine"]

我有一个JSON对象,看起来与

{
   "mydata":[
            "one",
            "two",
            "three"
            ],
   "outside":[
               {
                 "vals":["four", "five", "six"],
                 "soso":{"seven", "eight", "nine"]               
               },
               {
                 "vals":["four", "five", "six"],
                 "soso":{"seven", "eight", "nine"]               
               },
               {
                 "vals":["four", "five", "six"],
                 "soso":{"seven", "eight", "nine"]               
               },
              ]
   "inside":[]
我正在尝试使用jquery运行$。每个都在“外部”上,这样我就可以从“外部”获取每个VAL值集,我什么也得不到,但我失败了。我已经放弃了希望有人可以使用jquery提供帮助:

$.each(jsonObj.outside, function () {
    var i = this; // The current item
});
使用jQuery:

$.each(jsonObj.outside, function () {
    var i = this; // The current item
});

内部<代码>外部对象<代码>soso应如下所示

“soso”:[“七”、“八”、“九”]
然后

$.each(json.outside, function() {
    this.vals.each(function(index, val) {
       console.log(val); // output: "four", "five", "six"
    });

   this.soso.each(function(index, val) {
       console.log(val); // output: "seven", "eight", "nine
    });
});

内部<代码>外部对象<代码>soso应如下所示

“soso”:[“七”、“八”、“九”]
然后

$.each(json.outside, function() {
    this.vals.each(function(index, val) {
       console.log(val); // output: "four", "five", "six"
    });

   this.soso.each(function(index, val) {
       console.log(val); // output: "seven", "eight", "nine
    });
});

请包含一个更完整的代码示例您的JSON无效(即“soso”值以对象开头,但以数组形式结束-此外,“inside”前面没有逗号,结尾没有大括号)。您可以运行它来进行测试。一旦你有了一个有效的JSON对象,再来解释一下你的问题。。。。请引用适用的Jquery。此外,描述一下它是如何惨败的可能会有所帮助。(是否返回错误的数据?是否返回空值?页面中的javascript是否完全关闭?)请包含一个更完整的代码示例您的JSON无效(即“soso”值以对象开头,但以数组形式结束-此外,“inside”之前没有逗号,结尾没有右括号)。您可以运行它来进行测试。一旦你有了一个有效的JSON对象,再来解释一下你的问题。。。。请引用适用的Jquery。此外,描述一下它是如何惨败的可能会有所帮助。(是否返回错误的数据?是否返回空值?页面中的javascript是否完全关闭?)