Javascript examples for jQuery Method and Property:ajax
Opening the result of GET request with data in a new tab
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.js"></script> <script type="text/javascript"> window.onload=function(){//ww w .java 2 s .c om var root = 'https://jsonplaceholder.typicode.com'; $.ajax({ url: root + '/posts/1', method: 'GET' }).then(function(data) { var newWindow = window.open(); newWindow.document.write(data.title); }); } </script> </head> <body> </body> </html>