<!DOCTYPE html>
<html>
<head>
    <title>Is it on Nightly?</title>

    <script>
        window.onload = () => {
            var form = document.forms['changeset_form'];
            form.addEventListener('submit', (e) => {
                e.preventDefault();
                var formData = new FormData(form);
                var changesetId = formData.get('changeset_id');
                var requestPath = 'changeset/' + changesetId;

                var req = new XMLHttpRequest();
                req.onload = (e) => {
                    var parsed = JSON.parse(req.response);
                    var result = parsed.inNightly ? 'Yes!' : 'No';
                    document.getElementById('result').innerHTML = result;
                };
                req.open('GET', requestPath);
                req.send();
            });
        };
    </script>
</head>
<body>

    <h1>Is it on Nightly?</h1>
    <p>Pass in a changeset id to find out if it's in the latest nightly build.</p>

    <form id="changeset_form" >
        Changeset: <input type="text" name="changeset_id"/>
        <input type="submit" value="Find out"/>
    </form>

    <h2 id='result'></h2>

</body>
</html>

<!DOCTYPE html>
<html>
<head>
    <title>Is it on Nightly?</title>

    <script>
        window.onload = () => {
            var form = document.forms['changeset_form'];
            form.addEventListener('submit', (e) => {
                e.preventDefault();
                document.getElementById('result').innerHTML = '';

                var formData = new FormData(form);
                var changesetId = formData.get('changeset_id');
                var requestPath = 'changeset/' + changesetId;

                var req = new XMLHttpRequest();
                req.onload = (e) => {
                    var parsed = JSON.parse(req.response);
                    var result = parsed.inNightly ? 'Yes!' : 'No';
                    document.getElementById('result').innerHTML = result;
                };
                req.open('GET', requestPath);
                req.send();
            });
        };
    </script>
</head>
<body>

    <h1>Is it on Nightly?</h1>
    <p>Pass in a changeset id to find out if it's in the latest nightly build.</p>

    <form id="changeset_form" >
        Changeset: <input type="text" name="changeset_id"/>
        <input type="submit" value="Find out"/>
    </form>

    <h2 id='result'></h2>

</body>
</html>

Clear result field when submitting changeset.
Clear result field when submitting changeset.
