SoFunction
Updated on 2025-04-07

Asynchronous loading implementation code of xhEditor

function editor($content,$name)
{
  $editor=<<<EOT
$(document).ready(
    function(){
        if(!$.isFunction($.xheditor))
        {
            $.get(
                '../',
                function(data){
                    eval(data);
                }
            );
        }
        $('#{$name}').xheditor(true);
    }
);
<textarea name="$name" rows="10" cols="60">$content</textarea>
EOT;
  return $editor;
}