zoukankan      html  css  js  c++  java
  • 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
    
            }
  • 相关阅读:
    Java 多线程(一) 基础知识与概念
    hashMap和treeMap
    转:Java IO流学习总结
    hibernate缓存
    java aio nio bio
    java1.8新特性
    LeetCode Contiguous Array
    LeetCode Sort Characters By Frequency
    LeetCode Subarray Sum Equals K
    LeetCode Group Anagrams
  • 原文地址:https://www.cnblogs.com/softidea/p/3311631.html
Copyright © 2011-2022 走看看