Hello HTML World

This guide demonstrates the basics of creating an HTML page that calls the JavaScript web service.

  1. Create a HTML file. In this guide, we use the hellowebworld.html name for the file.
  2. Add the following code to the file:
    <!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>
                    
  3. Save the file on the server:

To test the HTML page:

  1. In a browser, go to https://thePublicDNS/hellowebworld.html URL.
  2. The browser will render "Hello Web World".

See Also:

Hello Web Service World

Table of Contents