Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <script>
- function callAwsLambdaFunction() {
- var xhttp = new XMLHttpRequest();
- xhttp.onreadystatechange = function() {
- if (this.readyState == 4 && this.status == 200) {
- document.getElementById("myDiv").innerHTML = this.responseText;
- }
- };
- xhttp.open("GET", "https://test123.ap-south-1.amazonaws.com/dev", true);
- xhttp.send();
- }
- </script>
- <title>Hello World!</title>
- </head>
- <body>
- <h1>Hello world!</h1>
- <h1>Click below button to call API gatway and display result below!</h1>
- <h1><div id="myDiv"></div></h1>
- <button onclick="callAwsLambdaFunction()">Click me!</button><br>
- Regards,<br/>
- Aniket
- </body>
- </html>
Add Comment
Please, Sign In to add comment