Skip to content

Commit

Permalink
Update example - func call from html
Browse files Browse the repository at this point in the history
  • Loading branch information
olavpo committed Jan 21, 2024
1 parent 1d68bd3 commit e1dd710
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,9 @@ async function testApi() {
var sysInfo = await d2Get("/api/system/info.json");
console.log(sysInfo.version);
}
testApi();

window.helloWorld = async function () {
await testApi();
alert("Hello world...");

};
2 changes: 2 additions & 0 deletions src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@

<div class="mainView">
<p>Content goes here...</p>

<button onclick="helloWorld()">Hello</button>
</div>
</body>

Expand Down

0 comments on commit e1dd710

Please sign in to comment.