Good day. I am interested in the question of transferring data using javascript. Suppose there are two sites located on different hosts, is it possible to send variables from one site to another and return the result using JS.
- learn.javascript.ru/xhr-crossdomain - zloctb
|
1 answer
For cross-domain queries, use the JSONP format.
If you use jquery, the query will look something like this.
$.ajax({ url: "http://domain.com/", dataType: "jsonp", success: function(data) { console.log(data); } });
- Thank. That's how I imagined it. - alexsis20102
|