How to read both single object & array of objects in json using javascript/jquery -


I wrote Jason Reader to read data & amp; {"Value": "new", "onclick": "createNidoc ()"}, {"value": "open", "file", "value": "file", "popup": {"menuitem" , "Onclick": "OpenDec ()", {"value": "off", "onclick": "CloseDoc ()"}]}}}

but when Jason A By way of the API, a menu item returns

  {"menu": {"id": "file", "value": "file", "popup": {"menuitem": {"Value": "close", "onclick": "CloseDoc ()"}}}}  

The menu item is an object instead of an array. Therefore, my Jason Reader has failed to read because I read the menu of menutom by looping.

The solution is appreciated How is it controlled by other major sites?

This is perfect for jQuery's MakeEye . -

It takes anything and returns an array, so if it is already an array that passes it, but if it is a scalar, then it creates a single value array is . Then you can iterate the result.


Comments

Popular posts from this blog

Eclipse CDT variable colors in editor -

AJAX doesn't send POST query -

wpf - Custom Message Box Advice -