javascript - How to use JSON.stringify() -


i trying consume data api using rest call . i've succeeded data api : can check demo on jsfiddle : http://jsfiddle.net/ztxyq/33/

now , trying perform work different resources api reading these 2 articles : - http://www.jquery4u.com/demos/ajax/ - http://welcome.totheinter.net/tutorials/model-view-controller-in-jquery/

i know why use json.stringify() if can show data in html pages . why use so-called 'class'/'model' parse data using json ?

regards ,

json data structure, means serves transport variables, arrays , stuff.

sending variables in html code silly - why use json.

json.stringify() utility function, commonly used debugging, when want print variable console, there other uses, too.

console.log( json.stringify(myobject) ); 

what function does, takes object, array or else, , makes readable string of it, while using ↓↓ give [object].

console.log( myobject ); 

if want send html displayed, don't need bother json @ all, , use jquery.load() or similar.


Comments

Popular posts from this blog

basic authentication with http post params android -

vb.net - Virtual Keyboard commands -

css - Firefox for ubuntu renders wrong colors -