3 Star 17 Fork 8

独立观察员/Practice

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
HTMLBrowserJs.html 711 Bytes
一键复制 编辑 原始数据 按行查看 历史
<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8" />
<title></title>
<script>
//alert("准备就绪");
window.external.ShowMsgForJs("准备就绪");
function ShowMsgForCSharp(str) {
var msg = "收到消息:" + str;
//1、调用C#方法;
window.external.ShowMsgForJs(msg);
//2、改变网页内容;
document.getElementById("info").innerHTML += msg + "<br/>";
//3、弹窗;
alert(msg);
}
</script>
</head>
<body>
<div>通过 WebBrowser 让 JS 与 C# 代码交互 测试页</div>
<div id="info"></div>
</body>
</html>
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/dlgcy/Practice.git
git@gitee.com:dlgcy/Practice.git
dlgcy
Practice
Practice
master

搜索帮助