<html>
    <head>
        <title>Modules test page</title>
        <meta name="description" content="Test how your browser handles JavaScript modules." />
        <link rel="stylesheet" type="text/css" href="css/common.css">
    </head>
    <body>
        <h1>Modules test page</h1>
        <noscript><p>JavaScript is not supported or disabled in your browser.
            There is no chance of this working.</p></noscript>
        <p id="supported"></p>
        <p id="document"></p>
        <p id="window"></p>

        <script nomodule>
            document.getElementById('supported').innerText = 'Modules not supported';
        </script>

        <script type="module">
            document.getElementById('supported').innerText = 'Modules supported';

            import { has_document, has_window } from '/javascript-test-pages/js/available-in-module.js';

            var d = document.getElementById('document')
            if (has_document()) {
                d.innerText = 'Document available in modules';
            }

            var w = document.getElementById('window')
            if (has_window()) {
                w.innerText = 'Window available in modules';
            }
        </script>
    </body>
</html>

<html>
    <head>
        <title>Modules test page</title>
        <meta name="description" content="Test how your browser handles JavaScript modules." />
        <link rel="stylesheet" type="text/css" href="css/common.css">
    </head>
    <body>
        <h1>Modules test page</h1>
        <noscript><p>JavaScript is not supported or disabled in your browser.
            There is no chance of this working.</p></noscript>
        <p id="supported"></p>
        <p id="document"></p>
        <p id="window"></p>

        <script nomodule>
            document.getElementById('supported').innerText = 'Modules not supported';
        </script>

        <script type="module">
            document.getElementById('supported').innerText = 'Modules supported';

            import { has_document, has_window } from './js/available-in-module.js';

            var d = document.getElementById('document')
            if (has_document()) {
                d.innerText = 'Document available in modules';
            }

            var w = document.getElementById('window')
            if (has_window()) {
                w.innerText = 'Window available in modules';
            }
        </script>
    </body>
</html>

Use a relative path to load the JS module.
Use a relative path to load the JS module.
