Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions dfx/assets/new_project_files/src/hello/public/hello.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { hello } from '../src/hello/main';
import hello from '../../../canisters/hello/main.js';

window.hello = async function(name) {
const response = await hello.main(name);
console.log(response);
const reply = await hello.main(name);
document.getElementById('output').innerText = reply;
};
17 changes: 8 additions & 9 deletions dfx/assets/new_project_files/src/hello/public/index.html
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
<html>
<head>
<script type="application/javascript" src="hello.js"></script>
</head>
<body>
<div>Press button, receive Hello!</div>

<button onclick="hello('{project_name}')">Press me!</button>
<div id="output"></div>
</body>
<head>
<script type="module" src="./hello.js"></script>
</head>
<body>
<div>Press button, receive Hello!</div>
<button onclick="hello('{project_name}')">Press me!</button>
<div id="output"></div>
</body>
</html>