0

i cannot get the json datas via

     jQuery.parseJSON(myArr);
              $.each(myArr, function(key, value) { 
  alert(key + ': ' + value); 
});

What's wrong ?

0

1 Answer 1

2

You need to capture the return of the parseJSON method.

jQuery.parseJSON(myArr);

should read

myArr = jQuery.parseJSON(myArr);

otherwise, you are passing a string into the $.each method.

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.