0

please help for my Code.

var langeJSON = {
    "placeholder":[
    	{ "#iEmail"   :"eMail-Adresse" },
    	{ "#iPasswort": "Passwort" }
    ],
    "text":[
    	{ "#pLoginText"	: "Login..." }
    ]
}

$.each(langeJSON, function(k, v) {
     console.info(k + ' x ' + v);
     $.each(v, function(k1, v1) {
          console.info(k1 + ' - ' + v1);
     })
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>

Should look like this, this is false

placeholder x [object Object],[object Object]
0 - [object Object]
1 - [object Object]
text x [object Object]
0 - [object Object]

but looks like

placeholder x [object Object],[object Object]
0 - #iEmail
1 - eMail-Adresse
0 - #iPasswort
1 - Passwort
text x [object Object]
0 - pLoginText
1 - Login...

Blackout at the moment, please Help

regards Volker Sorry my English is not Good ;o)

1
  • 2
    What do you mean by "Should look like this, this is false"? Is that the output you want or not? Because when I run your code that's what I get. Commented Nov 22, 2014 at 12:05

1 Answer 1

1
var langeJSON = {
        "placeholder":
        [
            { "#iEmail"     :"eMail-Adresse" },
            { "#iPasswort"  : "Passwort" }
        ],
        "text":
        [
            { "#pLoginText" : "Login..." }
        ]
    }

     $.each(langeJSON, function(k, v) {
            console.info(k + ' x ' + v);
            $.each(v, function(k1, v1) {
              //  console.info(k1 + ' - ' + v1);
               $.each(v1,function(k2,v2)
                      {
                      console.info(k2+':'  +v2);                          });

            });    });

Your missing the one more each function

see the output : http://jsfiddle.net/2ytypjmg/

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.