24 lines
555 B
JavaScript
24 lines
555 B
JavaScript
// JavaScript Document
|
|
|
|
function myFunction() {
|
|
let myVar = 'Hello, Wappler!';
|
|
return myVar;
|
|
}
|
|
|
|
function runMyFunction() {
|
|
// alert("function run")
|
|
let result = generateRandomIdentifier(9);
|
|
// Use Wappler dmx.set to bind result to a Wappler variable if needed
|
|
//<p>{{myResult}}</p>
|
|
console.log(result)
|
|
dmx.global.set('myResult', result);
|
|
|
|
}
|
|
async function toBase64(filePath) {
|
|
const img = await fetch(filePath).then(res => res.arrayBuffer())
|
|
console.log(img)
|
|
dmx.global.set('imgResult', img)
|
|
return img
|
|
}
|
|
|