Script type = module non pris en compte
Bonjour,
module JavaScript que j'ai crée ne marche pas.
Les 2 fichiers fix.html et dispMod.js sont dans un même répertoire.
fix.html
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
| <!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Module JavaScript</title>
</head>
<body>
<script type="module">
import {display} from './dispMod.js'
display();
</script>
</body>
</html> |
dispMod.js
Code:
1 2 3
| export function display() {
console.log('Hello world');
} |
Bien cordialement et Sincères mercis,
BobotamVsKakolapisos