Skip to content

All JavaScript breaks if an HTML id="module" is in the markup #57

@elachlan

Description

@elachlan

Problem/Motivation
All JavaScript breaks if an HTML id="module" is in the markup.

This issue was stumbled across in Drupal.
The issue for it is located at: https://www.drupal.org/project/drupal/issues/2961308

I have tested it in IE 11, Edge, and Chrome.

I believe it might be in issue in drupal because domready is loaded with the rest of the javascript at the bottom of the document.

Here is the amended test that fails.

<!DOCTYPE HTML>
<html lang="en-us">
  <head>
    <meta http-equiv="Content-type" content="text/html; charset=utf-8">
    <title id="module">domReady test</title>
    <script src="../src/ready.js"></script>
    <script type="text/javascript">
      domready(function () {
        document.getElementById('title').innerHTML = 'domready'
        domready(function () {
          document.getElementById('title').innerHTML += '✓'
        })
      })
    </script>
  </head>
  <body>
    <h1 id="title"></h1>
  </body>
</html>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions