ros2-web-bridge
ros2-web-bridge copied to clipboard
Put the script section at the bottom of the body element for examples
Currently the example html files are all like this:
...
<script src="https://static.robotwebtools.org/roslibjs/current/roslib.js"></script>
<script>
// inline JS code calls roslibjs API
</script>
<body>
// div elements
</body>
We suggest to put the inline JavaScript code at the bottom of the body element. The inline JavaScript code contains DOM operations. If there is only async code, it might be fine. But if there is only sync code, it will raise errors. In brief, to avoid any errors, we suggest to put the inline code at the bottom.