我试图从使用FCKeditor创建的textarea框中删除内容或值。我已经尝试过javaScript和jquery的所有标准方法,它仍然存在,所以我可能会遗漏一些东西。
这是一个我无法控制的开发环境,我们使用的是IE8和FCKeditor 2.6.6
以下是创建TextArea的代码(我无法控制)
<script type="text/javascript">
//<![CDATA[
window.onload = function()
{
var oFCKeditor = new FCKeditor( 'Absence Date' ) ;
oFCKeditor.BasePath = "/fckeditor/" ;
oFCKeditor.ToolbarSet = "Composer" ;
oFCKeditor.ReplaceTextarea() ;
var oFCKeditor = new FCKeditor( 'Hours Counted Against' ) ;
oFCKeditor.BasePath = "/fckeditor/" ;
oFCKeditor.ToolbarSet = "Composer" ;
oFCKeditor.ReplaceTextarea() ;
var oFCKeditor = new FCKeditor( 'test' ) ;
oFCKeditor.BasePath = "/fckeditor/" ;
oFCKeditor.ToolbarSet = "Composer" ;
oFCKeditor.ReplaceTextarea() ;
};
function FCKeditor_OnComplete( editorInstance )
{
if (editorInstance.Name == "Absence Date")
{
editorInstance.EditorWindow.parent.FCKToolbarItems.GetItem( 'About' )._UIButton.MainElement.title = 'Absence Date';
FCKeditorAPI.GetInstance('Absence Date').Commands.GetCommand('About').Execute = function() { return false; };
};
if (editorInstance.Name == "Hours Counted Against")
{
editorInstance.EditorWindow.parent.FCKToolbarItems.GetItem( 'About' )._UIButton.MainElement.title = 'Hours Counted Against';
FCKeditorAPI.GetInstance('Hours Counted Against').Commands.GetCommand('About').Execute = function() { return false; };
};
if (editorInstance.Name == "test")
{
editorInstance.EditorWindow.parent.FCKToolbarItems.GetItem( 'About' )._UIButton.MainElement.title = 'test';
FCKeditorAPI.GetInstance('test').Commands.GetCommand('About').Execute = function() { return false; };
};
};
(function() {var fn = function() {$get("toolkitScriptManager_HiddenField").value = '';Sys.Application.remove_init(fn);};Sys.Application.add_init(fn);})();Sys.Application.add_init(function() {
$create(Sys.Extended.UI.CalendarBehavior, {"button":$get("imageDateSelection"),"format":"MMMM d, yyyy","id":"calendarExtenderDateSelection"}, null, null, $get("textBoxDateSelection"));
});
//]]>
</script>
以下是来自HTML的HTML:
<textarea id="test" title="test" rows="5" cols="75" name="test"></textarea></div>
我想要做的是清除&#34;测试&#34; ID位于文档顶部的另一个函数中。
我能够从中读取但只是不删除它,我知道这是一个较旧的软件,但有人可以给我任何可能完成此任务的代码吗?
谢谢!
答案 0 :(得分:0)
好的,我也能想出这个,我把它放在这里让任何人知道谁可能有类似的问题。首先我发现TA然后设置一个变量并清除它。
var TA = FCKeiditorAPI.GetInstance('test'); //sets VAR to instance of TA
TA.setData(""); // clears data from the TA