diff --git a/index.html b/index.html index f5b323b..1b09644 100644 --- a/index.html +++ b/index.html @@ -111,6 +111,5 @@

Hello world! This is HTML5 Boilerplate.

- diff --git a/src/hello.js b/src/hello.js deleted file mode 100644 index d8d52e9..0000000 --- a/src/hello.js +++ /dev/null @@ -1,4 +0,0 @@ -// src/hello.js -export function sayHello() { - console.log('Hello, dynamic import!'); -} diff --git a/src/index.js b/src/index.js deleted file mode 100644 index fa2ef27..0000000 --- a/src/index.js +++ /dev/null @@ -1,16 +0,0 @@ -// src/index.js - -// Add a button to the HTML body to trigger the dynamic import -document.body.innerHTML = ''; - -// Add an event listener to the button -document.getElementById('loadHello').addEventListener('click', () => { - // Use dynamic import to load the hello.js module - import('./hello') - .then((module) => { - module.sayHello(); // Call the function from the dynamically loaded module - }) - .catch((err) => { - console.error('Failed to load module', err); - }); -});