energy/example/browser-execute-javascript/resources/execute-javascript.html

24 lines
679 B
Go
Raw Normal View History

2022-11-23 15:40:47 +08:00
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>execute-javascript</title>
<script type="application/javascript">
function GoExecuteJSFunc(param, param1) {
let message = document.getElementById("message");
2022-11-23 18:36:17 +08:00
message.innerHTML = message.innerHTML + "param0: " + param + " param1: " + param1 + "<br>"
2022-11-23 15:40:47 +08:00
if (param % 2 === 0) {
message.style.color = "red"
} else {
message.style.color = "blue"
}
}
</script>
</head>
<body style="overflow: hidden;margin: 0px;padding: 0px;">
execute-javascript:<br>
<div id="message">
</div>
</body>
</html>