以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  在微信里如何用JS关闭当前网页?  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=117827)

--  作者:xietan417
--  发布时间:2018/4/19 15:55:00
--  在微信里如何用JS关闭当前网页?
function myfuncton() {
window.close();
}


--  作者:有点甜
--  发布时间:2018/4/19 15:59:00
--  

WeixinJSBridge.call(\'closeWindow\');

 

 


--  作者:xietan417
--  发布时间:2018/4/19 16:05:00
--  
直接这样写?
function myfuncton() {
WeixinJSBridge.call(\'closeWindow\');
}

--  作者:有点甜
--  发布时间:2018/4/19 17:04:00
--  
是的,点击按钮调用myfunction函数即可。
--  作者:xietan417
--  发布时间:2018/5/8 12:04:00
--  
Dim e As RequestEventArgs = args(0)
Dim wb As New weui
Dim sb As New StringBuilder
Dim cmd As New SQLCommand
Dim dt As DataTable
*****************
dt = cmd.ExecuteReader
Dim userid = Functions.Execute("order",e)
  If userid > "" Then
    With wb.AddTable("","Table1")
        \'按日期顺序列出考勤明细
        .CreateFromDataTable(dt,False,"userid =\'" & UserId & "\'","日期","姓名","日期","星期","t1","t2")
    End With
wb.AddForm("","form1","kq.htm")
  With wb.AddButtonGroup("form1","btg1",False)
       .Add("btn1","关闭","button").Attribute=""
  End With
wb.AppendHTML("<script src=\'./lib/close.js\'></script>")  \'引入脚本文件
e.WriteString(wb.Build)
End If

关闭按键没有反应,我的代码没问题吧?

--  作者:有点甜
--  发布时间:2018/5/8 12:16:00
--  

试试改成

 

 .Add("btn1","关闭","button").Attribute="onclick=""alert(123);WeixinJSBridge.call(\'closeWindow\');alert(456);"""


--  作者:xietan417
--  发布时间:2018/5/8 13:41:00
--  
谢谢甜版,又给我上了一课!