---
title: "JSONP"  
description: "JSONP"  
author: "Anonymous User"  
published: 2018-07-03  
updated: 2018-07-03  
canonical: https://www.mindstick.com/forum/34573/jsonp  
category: "json"  
tags: ["json", "json encode", "json decode"]  
reading_time: 1 minute  

---

# JSONP

What is [Jsonp](https://www.mindstick.com/forum/160093/what-is-jsonp-and-why-is-it-used-in-web-development)? [Difference](https://www.mindstick.com/articles/157114/good-news-or-bad-news-and-the-difference-is) between [Json](https://www.mindstick.com/forum/34446/convert-json-string-to-object) and Jsonp ?

## Replies

### Reply by Anonymous User

thanks for this

### Reply by Prakash nidhi Verma

JSONP :

JSONP means JSON with Padding.

JSONP does not use the XMLHttpRequest object.

JSONP uses the <script> tag instead.

Requesting an external script from another domain does not have this problem.

JSONP uses this advantage, and request files using the script tag instead of the XMLHttpRequest object.

Syntax:

```
<script src="demo_jsonp.php"> 
```

\

Server File :

```
 <?php $myJSON = '{ "name":"Prakash", "age":19, "city":"Allahabad" }';
echo "myFunc(".$myJSON.");";
?>
```

\

Callback Function:

```
function clickButton() {     var s = document.createElement("script");
    s.src = "jsonp_demo_db.php?callback=myDisplayFunction";
    document.body.appendChild(s);
}
```


---

Original Source: https://www.mindstick.com/forum/34573/jsonp

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
