mirror of
https://github.com/hanzoai/quickjs-emscripten.git
synced 2026-10-30 19:37:29 +00:00
23 lines
636 B
HTML
23 lines
636 B
HTML
<!doctype html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8" />
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
<title>IIFE Global example</title>
|
|
</head>
|
|
<body>
|
|
Open your console
|
|
</body>
|
|
<!-- Add a script tag to load the library as the QJS global -->
|
|
<script
|
|
src="https://cdn.jsdelivr.net/npm/[email protected]/dist/index.global.js"
|
|
type="text/javascript"
|
|
></script>
|
|
<!-- Then use the QJS global in a script tag -->
|
|
<script type="text/javascript">
|
|
QJS.getQuickJS().then((QuickJS) => {
|
|
console.log(QuickJS.evalCode("1+1"))
|
|
})
|
|
</script>
|
|
</html>
|