Dodaje koleje wiersze w tabeli i wstawiam fck
<script type="text/javascript"> function jakas_funkcja(){ var tbl = document.getElementById('table1'); var lastRow = tbl.rows.length - 1; var row = tbl.insertRow(lastRow); var cell = row.insertCell(0); var fck = new FCKeditor("id199"); fck.BasePath = "../../js/fckeditor/" ; fck.Width = "100%" ; fck.Height = "80"; fck.ToolbarSet = "Basic" ; cell.innerHTML = fck.CreateHtml(); } </script>
Nadmienię też że dodania fckeditora przy użyciu php czy czystego js działają bezproblemowo np.
A oto moje nieudane próby dodania fckeditora przy pomocy DOM
Tutaj cała strona wypełnia mi sie na czarno
<script type="text/javascript"> function jakas_funkcja(){ var tbl = document.getElementById('table1'); var lastRow = tbl.rows.length - 1; var row = tbl.insertRow(lastRow); var cell = row.insertCell(0); var desc_edit = 'var oFCKeditor = new FCKeditor("id199");'+"\n"; desc_edit += 'oFCKeditor.BasePath = "../../js/fckeditor/" ;'+"\n"; desc_edit += 'oFCKeditor.Width = "100%" ;'+"\n"; desc_edit += 'oFCKeditor.Height = "80" ;'+"\n"; desc_edit += 'oFCKeditor.ToolbarSet = "Basic" ;'+"\n"; desc_edit += 'oFCKeditor.Create();'+"\n"; var el = document.createElement('script'); el.setAttribute('type','text/javascript'); el.text = desc_edit; cell.appendChild(el); } </script>
a tutaj wpisuje mi sie kod html a nie pojawia sie edytor
screen ->

<script type="text/javascript"> function jakas_funkcja(){ var tbl = document.getElementById('table1'); var lastRow = tbl.rows.length - 1; var row = tbl.insertRow(lastRow); var cell = row.insertCell(0); var fck = new FCKeditor("id199"); fck.BasePath = "../../js/fckeditor/" ; fck.Width = "100%" ; fck.Height = "80"; fck.ToolbarSet = "Basic" ; var el = document.createTextNode(fck.CreateHtml()); cell.appendChild(el); } </script>