我试过这个:
string newScript = textBox1.Text;
HtmlElement head = browserCtrl.Document.GetElementsByTagName("head")[0];
HtmlElement scriptEl = browserCtrl.Document.CreateElement("script");
lblStatus.Text = scriptEl.GetType().ToString();
scriptEl.SetAttribute("type", "text/javascript");
head.AppendChild(scriptEl);
scriptEl.InnerHtml = "function sayHello() { alert('hello') }";
Run Code Online (Sandbox Code Playgroud)
scriptEl.InnerHtml和scriptEl.InnerText都给出了错误:
System.NotSupportedException: Property is not supported on this type of HtmlElement.
at System.Windows.Forms.HtmlElement.set_InnerHtml(String value)
at SForceApp.Form1.button1_Click(Object sender, EventArgs e) in d:\jsight\installs\SForceApp\SForceApp\Form1.cs:line 31
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at …Run Code Online (Sandbox Code Playgroud) 给定一个表名,如何从plpgsql函数中提取主键列及其数据类型列表?
这与"没有单独的连接表的Hibernate @OneToMany"类似,我需要一个没有连接表的@OneToMany关系.但是,我还想不定义反比关系.删除反转似乎会导致自动生成连接表...是否有解决方法?
.NET框架中是否内置了将HSV转换为RGB的API ?我没有在System.Drawing.Color中看到一个方法,但是平台上没有一个方法似乎令人惊讶.
有没有人在现实世界中都有过这方面的经历?他们如何在性能(内存使用,速度等)方面进行比较?稳定性?
JBoss Seam在Glassfish上运行良好吗?
什么是实际工作的最小的Java SVG引擎(最小/最小的罐子)?如果你的答案是Batik,那么最小的dep是什么.让它在一个简单的Java应用程序中工作的图表?
我查看了Batik网站上的依赖图,但它看起来像是典型的Apache混乱.还有更好的选择吗?
什么是最简单的C函数,用于启动R解释器,传入一个小表达式(例如,2 + 2),并得出结果?我正在尝试使用Windows上的MingW进行编译.