123456789101112131415161718192021222324252627 |
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <title>Hello CORS</title>
- <script src="http://code.jquery.com/jquery-3.5.1.min.js"
- integrity="sha256-9/aliU8dGd2tb6OSsuzixeV4y/faTqgFtohetphbbj0="
- crossorigin="anonymous"></script>
- </head>
- <body>
- <div>
- <p class="greeting-id">The ID is </p>
- <p class="greeting-content">The content is </p>
- </div>
- <script>
- $(document).ready(function() {
- $.ajax({
- url: "http://localhost:8080/greeting"
- }).then(function(data, status, jqxhr) {
- $('.greeting-id').append(data.id);
- $('.greeting-content').append(data.content);
- console.log(jqxhr);
- });
- });
- </script>
- </body>
- </html>
|