I have all the html code of my site pages in database.. but how i load him to the editor to edit the code?
i try like that:
oFCKeditor.Value = <%=rs("Code")%>
but the string it too long and with ' and ", what make javascript error..
how i can load lot of html codes to the editor?
i try like that:
oFCKeditor.Value = <%=rs("Code")%>
but the string it too long and with ' and ", what make javascript error..
how i can load lot of html codes to the editor?
RE: How to load html to the editor?
.....
editor = new FCKeditor('MyEditor','100%',150,'Default',null)
.....
editor.Create()
.....
var fck = FCKeditorAPI.GetInstance("MyEditor");
<%
for () {
piece = rs("Code").substring(x,y)
%>
fck.InsertHtml(<%=piece%>,true)
<% } %>
.....
RE: How to load html to the editor?
var oFCKeditor ;
oFCKeditor = new FCKeditor('EditorDefault') ;
oFCKeditor.Height= "600"
oFCKeditor.Create() ;
var fck = FCKeditorAPI.GetInstance("EditorDefault");
fck.InsertHtml ('<TABLE width="100%">',true);
Error: => FCKeditorAPI is undefined
RE: How to load html to the editor?
-----------------------------------
function escapeJSChars( ejsc_value )
Dim ejsc_escCharArr, _
ejsc_i
ejsc_escCharArr = Split("\,',"",<,>,/", ",")
escapeJSChars = ejsc_value
for ejsc_i = 0 to UBound(ejsc_escCharArr)
escapeJSChars = Replace(escapeJSChars, ejsc_escCharArr(ejsc_i), "\" & ejsc_escCharArr(ejsc_i))
next
escapeJSChars = Replace(Replace(escapeJSChars, chr(10), chr(10) & "'"), chr(13), "' + " & chr(13))
end function
-----------------------------------
Then when you import your database values you'd simple pass it through the function:
-----------------------------------
oFCKeditor.Value = <%= escapeJSChars(rs("Code")) %>
-----------------------------------
When I was screwing around with the Javascript version I was escaping all the proper characters but I was still having problems, until I realized that my content from the database had carriage returns in it and those were breaking the code as well. Anyway, there may be some more characters that might need escaping, just add them to the ejsc_escCharArr array.
RE: How to load html to the editor?
thanks for the help!