JSON JSONP and P/JSON – Whats the difference?

  • Home
  • /
  • Blog
  • /
  • JSON JSONP and P/JSON – Whats the difference?

February 2, 2012

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"});

NickLitten


IBM i Software Developer, Digital Dad, AS400 Anarchist, RPG Modernizer, Shameless Trekkie, Belligerent Nerd, Englishman Abroad 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 remember: If at first you don't succeed then skydiving probably isn't a hobby you should look into.

Nick Litten

related posts:

{"email":"Email address invalid","url":"Website address invalid","required":"Required field missing"}

Start your
7-day free trial

Take This Course with ALL ACCESS

Unlock your Learning Potential with instant access to every course and all new courses as they are released.
 [ For Serious Software Developers only ]

IBM i Training For Technology Experts

New!

Successfully Work Remote 

 $ 129.00  $59.00

By adding new skills in information technology, employers will be confident that you have the necessary skills and tools needed to successfully work remotely

>

Snug CBD

 20% Discount

I have partnered with SNUG CBD givING you Organic CBD
20% discount code "NL20"