以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  利用webBrowser向js传值  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=117401)

--  作者:chenjiu6202
--  发布时间:2018/4/11 22:17:00
--  利用webBrowser向js传值

        Dim message As String = "dds|" & _UserName & "|rehryh" 

        Dim web = e.Form.Controls("WebBrowser1").BaseControl

        web.Document.InvokeScript("eval", new String() {"socket.emit(\'login\',message);" })

        蓝色的message怎么传入js中成为红色message


--  作者:有点甜
--  发布时间:2018/4/11 22:23:00
--  

改成这样

 

web.Document.InvokeScript("eval", new String() {"socket.emit(\'login\',\'" & message & "\');" })


--  作者:chenjiu6202
--  发布时间:2018/4/12 9:48:00
--  
谢谢了,甜老师!