This guide demonstrates the basics of creating an HTML page that calls the JavaScript web service.
<!DOCTYPE html> <html> <head> <title>Hello Web World</title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <script> function OnPageLoad() { var req = new XMLHttpRequest(); req.onreadystatechange = function () { if (req.readyState == 4) { if (req.status == 200) { document.getElementById("message").innerHTML = req.responseText; } } }; req.open("GET", "/hellowebworld.jsx"); req.send(); } </script> </head> <body onload="OnPageLoad();"> <div id="message"></div> </body> </html>
To test the HTML page: