This site is mobile accessible. Press the "Tap Here" button to use a different font-size.


Smartphone icons created by Freepik - Flaticon

Request With a Callback Function

The PHP file returns a call to the function you send as a callback.

let s = document.createElement("script");
s.src = "include/PHP/demo_jsonp.php?callback=myDisplayFunction";
document.body.appendChild(s);

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