123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- <html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
- <title></title>
- <meta charset="utf-8">
- </head>
- <script src="https://code.jquery.com/jquery-2.1.4.min.js"></script>
- <script>
- var test_val;
- function test() {
- alert("收到Net程序事件 " + test_val);
- }
- function testArg(d1, d2) {
- alert("收到Net程序事件1 " + d1);
- alert("收到Net程序事件2 " + d2);
- }
- $(function () {
- $('button:eq(0)').on("click", BtnClick);
- $('button:eq(1)').on("click", BtnClickArgs);
- });
- function BtnClick() {
- if (typeof jsObj == "undefined") {
- alert("jsObj参数未初始化");
- return;
- }
- jsObj.MessageText = "我是js";
- jsObj.ShowTest();
- }
- function BtnClickArgs() {
- if (typeof jsObj == "undefined") {
- alert("jsObj参数未初始化");
- return;
- }
- jsObj.ShowTestArg($('textarea:eq(0)').val());
- }
- </script>
- <body>
- <button style="margin-top:100px">发送给Net程序</button>
- <button>发送给Net程序带参数</button>
- <textarea></textarea>
- </body>
- </html>
|