I
I
iphone76g2015-10-03 19:22:21
JavaScript
iphone76g, 2015-10-03 19:22:21

How to make the simplest version of JSONP in JS?

Hello, how to make a simple Data request to an API on an external domain.
If there is an option to request JSONP

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Immortal_pony, 2015-10-03
@Immortal_pony

$.ajax({
    url: "your/api/url",
    dataType: "jsonp",
    success: function(response) {
        console.log(response); // server response
    }
});

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question