I have some problems with this code? Here is my code that creates text editor from area
var box;
...
box = jQuery("#text_vesti").htmlbox({
toolbars:[
[
// Cut, Copy, Paste
"cut","copy","paste",
// Undo, Redo
"undo","redo",
// Bold, Italic, Underline,
"bold","italic","underline"
],
[
// Left, Right, Center, Justify
"justify","left","center","right",
// Ordered List, Unordered List
"ol","ul",
// Hyperlink, Remove Hyperlink, Image
"link","unlink","image"
],
[// Show code
"code",
// Formats, Font size, Font family, Font color, Font, Background
"fontsize","fontfamily",
],
],
skin:"silver",
icons:"silk"
});
it’s create editor and it’s all ok, but…in some moment I have to put text in editor to re-edit text and I use this function…
function editujOvo (id){
editovanje = true;
id_za_editovanje = id;
jQuery("#r" + pom).css({"background":"none"});
jQuery("#r" + id).css({"background":"#dfdfdf"});
pom = id;
var podaci = "br=3&id=" + id;
// alert(podaci);
jQuery.post("ajax_exe.php", podaci,function(data){
//alert(data.id);
// alert(data.naslov);
alert(data.content);
document.getElementById("naslov_vesti").value = data.naslov;
//document.getElementById("text_vesti").value = data.content;
box=set_text(data.content);
document.getElementById("date").value = data.datum;
window.frames["news_page"].location.reload();
},'json');
}
but it does nothing, alert just before “set_text” function tels me that data exists and it is in right form and all, but something is missing…. any ideas????
———— And second question? in this version, or just in mine code, bold button first time does ok, but if I press it to return text to normal, it does nothing, actualy it sets one more pair of <b></b> tags around text (it’s shown in html preview).. where in code of HtmlBox plugin I can repair this function…. any one???? tnx..
set_text is suposed to be a global function?
i cant se it defined and the htmlbox plugin uses
nice encapsulation so i dont se it having global functions.
maybe the set_text is a method of the box?????
like
where is the set_text function from??