Guest User

Untitled

a guest
Oct 24th, 2017
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. <html>
  2. <head>
  3. <script>
  4. function callAwsLambdaFunction() {
  5. var xhttp = new XMLHttpRequest();
  6. xhttp.onreadystatechange = function() {
  7. if (this.readyState == 4 && this.status == 200) {
  8. document.getElementById("myDiv").innerHTML = this.responseText;
  9. }
  10. };
  11. xhttp.open("GET", "https://test123.ap-south-1.amazonaws.com/dev", true);
  12. xhttp.send();
  13.  
  14. }
  15. </script>
  16. <title>Hello World!</title>
  17. </head>
  18. <body>
  19. <h1>Hello world!</h1>
  20. <h1>Click below button to call API gatway and display result below!</h1>
  21. <h1><div id="myDiv"></div></h1>
  22. <button onclick="callAwsLambdaFunction()">Click me!</button><br>
  23. Regards,<br/>
  24. Aniket
  25. </body>
  26. </html>
Add Comment
Please, Sign In to add comment