Our Recommendation for You Search your Query, You can find easily. for example search by book name or course name or any other which is related to your education

label name

PHP

JSON JSONP

JSONPJAVASCRIPT


JSONP is a method for sending JSON data without worrying about cross-domain issues.
JSONP does not use the XMLHttpRequest object.
JSONP uses the <script> tag instead.

JSONP IntroJAVASCRIPT

JSONP stands for JSON with Padding.
Requesting a file from another domain can cause problems, due to cross-domain policy.
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.
<script src="demo_jsonp.php">

The Server FileJAVASCRIPT

The file on the server wraps the result inside a function call:

Example

<?php
$myJSON = '{ "name":"John", "age":30, "city":"New York" }';

echo "myFunc(".$myJSON.");";
?>
The result returns a call to a function named "myFunc" with the JSON data as a parameter.
Make sure that the function exists on the client.

The JavaScript functionJAVASCRIPT

The function named "myFunc" is located on the client, and ready to handle JSON data:

Example

function myFunc(myObj) {
    document.getElementById("demo").innerHTML = myObj.name;
}