📜 ⬆️ ⬇️

All you need for JSONP

If you want to work with JSONP, but there is no desire to connect for this great frameworks, then JSONP.js is your choice.
Liba weighs 216 bytes and has only one function, to which we pass the url and callback.

Accordingly, the author gives this example and code for it:
<script src="JSONP.js"></script> <script> this.onload = function () { var many = 0; JSONP("test.php?callback", function (a, b, c) { this.document.body.innerHTML += [ a, b, ++many, c ].join(" ") + "<br />"; }); JSONP("test.php?callback", function (a, b, c) { this.document.body.innerHTML += [ a, b, ++many, c ].join(" ") + "<br />"; }); }; </script> 

Quick and tasty.

')

Source: https://habr.com/ru/post/113955/


All Articles