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)
Rhumborl
16.7k4 gold badges42 silver badges47 bronze badges
-
2What 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.nnnnnn– nnnnnn2014年11月22日 12:05:01 +00:00Commented Nov 22, 2014 at 12:05
1 Answer 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/
answered Nov 22, 2014 at 12:11
asimshahiddIT
3302 silver badges5 bronze badges
Sign up to request clarification or add additional context in comments.
Comments
lang-js