javascript - PHP, MYSQL & JSON -
ok, i'm using ajax pull information mysql database , put onto screen. thing cannot understand json life of me. can suggest tutorials or help?
i mean can encode query via json guess it's javascript side not understand.
here's quick tutorial:
json means expressing data arrays, objects, , contents. has nothing object behaviour (methods).
<?php class test { public $hello = 'hello'; public $something = array('hello1', 'hello2'); public __construct() { } public void printhello() { echo $this->hello; } } ?> this class in json like:
var obj = { "hello": "hello", "something": ["hello1", "hello2"] }; as can see, json similar maps in lot of languages (key/value pairs). can see, data represented. json shorthand javascript builtins. example, previous object can written in javascript so.
var obj = new object(); obj.hello = "hello"; obj.something = new array("hello1", "hello2"); hope gives little idea of json about.
Comments
Post a Comment