Skip to content

Commit a3997a7

Browse files
Load index.js as module in jQuery
1 parent 36a78b6 commit a3997a7

4 files changed

Lines changed: 6 additions & 3 deletions

File tree

jQuery/package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

jQuery/src/data.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export const count = 0;

jQuery/src/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<link rel="stylesheet" type="text/css" href="index.css" />
1111
<script type="text/javascript" src="../node_modules/jquery/dist/jquery.js"></script>
1212
<script type="text/javascript" src="../node_modules/devextreme-dist/js/dx.all.js"></script>
13-
<script type="text/javascript" src="index.js"></script>
13+
<script type="module" src="index.js"></script>
1414
</head>
1515

1616
<body class="dx-viewport">

jQuery/src/index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1+
import { count as initialCount } from "./data.js";
2+
13
$(() => {
2-
let count = 0;
4+
let count = initialCount;
35
$('#btn').dxButton({
46
text: `Click count: ${count}`,
57
onClick(e) {

0 commit comments

Comments
 (0)