用webBrowser给“在线编辑器”添加内容
在一个页面中嵌入了“在线编辑器”,我想利用webBrowser自动在“在线编辑器”中添加内容,可以怎么也添加不进去。
曾经利用下面的语句去搜寻,可搜寻不到。
HtmlElement tbRemark = webBrowser1.Document.All[ "Composition "];
以下是页面的部分代码:
<tr>
<td align= "right " class= "TableRow2 "> <b> 课件简介: </b> </td>
<td colspan= "3 " class= "TableRow1 "> <textarea name= "content " style= "display:none "> </textarea>
<script src= '../editor/edit.js ' type=text/javascript> </script> </td>
</tr>
以下是edit.js的部分代码:
var strPath = "../editor/images/ ";
var strFilePath = "../editor/ ";
// 系统初试化 函数组开始
///////////////////////////////////////////////////////////////////////////////
SEP_PADDING = 5;
HANDLE_PADDING = 7;
var BrowserInfo = new Object() ;
BrowserInfo.MajorVer = navigator.appVersion.match(/MSIE (.)/)[1] ;
BrowserInfo.MinorVer = navigator.appVersion.match(/MSIE .\.(.)/)[1] ;
BrowserInfo.IsIE55OrMore = BrowserInfo.MajorVer > = 6 || ( BrowserInfo.MajorVer > = 5 && BrowserInfo.MinorVer > = 5 ) ;
var yToolbars = new Array();
var YInitialized = false;
document.writeln( " <link href=\ " " +strFilePath+ "editor.css\ " type=\ "text/css\ " rel=\ "stylesheet\ "> ");
document.writeln( " <table width=520 cellpadding=1 cellspacing=0 border=0 bgcolor=\ "#E8E8E8\ "> <tr valign= 'top '> <td colspan=2> ");
document.writeln( " <table width= '100% ' cellpadding=1 class= 'Toolbar ' cellspacing=0 border=0> <tr valign= 'top '> <td> <div class= 'yToolbar '> <div class= 'TBHandle '> </div> <select ID=formatSelect CLASS=\ "TBGen\ " onChange=\ "FormatText( 'FormatBlock ',this[this.selectedIndex].value);\ "> <option selected> 段落 </option> <option value=\ "<P>\ "> 正文 </option> <option value=\ "<H1>\ "> 标题一 </option> <option value=\ "<H2>\ "> 标题二 </option> <option value=\ "<H3>\ "> 标题三 </option> <option value=\ "<H4>\ "> 标题四 </option> <option value=\ "<H5>\ "> 标题五 </option> <option value=\ "<H6>\ "> 标题六 </option> <option value=\ "<PRE>\ "> 预设格式 </option> </select> <select name=\ "selectFont\ " CLASS=\ "TBGen\ " onChange=\ "FormatText( 'fontname ', selectF