ros2-web-bridge icon indicating copy to clipboard operation
ros2-web-bridge copied to clipboard

Put the script section at the bottom of the body element for examples

Open qiuzhong opened this issue 6 years ago • 0 comments

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.

qiuzhong avatar May 07 '18 02:05 qiuzhong