Warning: Declaration of TCB_Menu_Walker::walk($elements, $max_depth) should be compatible with Walker::walk($elements, $max_depth, ...$args) in /home/nicklit/www/www/wp-content/plugins/thrive-visual-editor/inc/classes/class-tcb-menu-walker.php on line 620

Warning: session_start(): Cannot start session when headers already sent in /home/nicklit/www/www/wp-content/plugins/userpro/includes/class-userpro.php on line 222
JSON JSONP and P/JSON - Whats the difference? - Nick Litten is IBM-i, AS400 iSeries RPG Programmer and Nerd

JSON JSONP and P/JSON – Whats the difference?

IBM i

Feb 02
json

Lets start from a point where you know what JSON is right?

JSON

JavaScript Object Notation or JSON (/JAY-sən), is an open-standard file format that uses human-readable text to transmit data objects consisting of attribute–value pairs and array data types. It is a very common data format used for asynchronous browser/server communication, including as a replacement for XML in some AJAX-style systems.

Data types in JSON include string, number, boolean, array

Simple Json might look like this:

{"name": "Nick","surname": "Litten", "website": "www.nicklitten.com"}

JSONP (also called P/JSON)

JSONP (JSON with padding) is used to request data from a server residing in a different domain than the client. JSONP enables sharing of data bypassing same-origin policy.

JSONP means its JSON with padding around it, normally used to request data from a server in a different domain.

Simple JsonP might look like

functioncallExample({"name": "Nick","surname": "Litten", "website": "www.nicklitten.com"});

 

 

Follow

About the Author

IBM i Software Developer, Digital Dad, AS400 Anarchist, RPG Modernizer, Alpha Nerd and Passionate Eater of Cheese and Biscuits. Nick Litten Dot Com is a mixture of blog posts that can be sometimes serious, frequently playful and probably down-right pointless all in the space of a day. Enjoy your stay, feel free to comment and in the words of the most interesting man in the world: Stay thirsty my friend.