• webbrowser在html中写入内容并添加js


    在html中写入内容,并添加js

            private void btnTestJs_Click(object sender, EventArgs e)
            {
                this.webBrowser1.Navigate("about:blank");
                this.webBrowser1.Document.Write("testBody");//make the this.webBrowser1.Document.Body is not null             
                HtmlElement he = this.webBrowser1.Document.CreateElement("script");
                he.SetAttribute("type","text/javascript");
                he.SetAttribute("text","alert('test');");
                this.webBrowser1.Document.Body.AppendChild(he);//add element
    
            }
  • 相关阅读:
    Web开发快速上手
    前端概述
    Python语言进阶
    图像和办公文档处理
    网络编程
    进程和线程
    正则表达式
    面向对象进阶
    面向对象
    js 获取指定时间上月26 ,
  • 原文地址:https://www.cnblogs.com/softidea/p/3311631.html
Copyright © 2020-2023  润新知