Hello, Internet applications are increasingly using AJAX technology, which allows you to transfer data from the browser to the server and back without reloading the page. But what to do if we can not use AJAX, and the data must be obtained.
A typical example where we cannot use AJAX is to get data from another domain. Now I will tell you about the method that helps to solve this problem.
The method is very simple, we create a script tag, and the browser itself loads the data.
')
var script = document.createElement ('script');
script.setAttribute ('type', 'text / javascript');
script.setAttribute ('language', 'JavaScript');
script.setAttribute ('src', 'Your url');
document.getElementsByTagName ('head') [0] .appendChild (script);
Well, that's it, on the server, we can generate the script we need.
PS In order to completely deceive the browser, you can send a header to the server: "Content-Type: text / javascript", but it works without it.