For simplification purposes, I want to create a simple HTML file with inline javascript that utilizes the strtotime function at https://locutus.io/php/datetime/strtotime/ (also on Github) as follows:
<html>
<head>
<script src='strtotime.js'></script>
</head>
<body>
<script>
alert(strtotime('today'));
</script>
</body>
</html>
When I load the page in my browser, it says:
Uncaught ReferenceError: module is not defined
Is it possible to use this javascript function without node? If so, what do I need to do in order to make it work?
EDIT: As per @streetcoder's comment, I tried this:
<html>
<body>
<script type="module">
import { strtotime } from 'strtotime.js';
alert(strtotime('today'));
</script>
</body>
</html>
and I get
Uncaught SyntaxError: import not found: strtotime