Fckeditor preview


Include this file in your below page

<script type=”text/javascript” src=”../fckeditor/fckeditor.js”></script>

——- php script ———-

<?php     $fckObj = new FCKeditor(‘editor’);
$fckObj->BasePath    = ‘fckeditor’;
$fckObj->Value        =  $catdesc;
$fckObj->Width  = ‘100%’ ;
$fckObj->Height = ‘400’ ;
$fckObj->Create();
?>

——- php script ———-

——– html script ———-

<input type=”button” value=”preview”  name =”preview” onclick= “preview()” />

——– html script ———-

———- javascript script ———

<script language=”javascript”>

function preview(){

var edit={}
var oEditor = FCKeditorAPI.GetInstance(‘editor’) ;
edit.show=oEditor.EditorDocument.body.innerHTML;
edit.pagename= ‘Fckedior preivew’;

var ret;
ret = window.showModalDialog(“preview.php”, edit,”dialogWidth:1020px;dialogHeight:680px;help:no;status:no;scroll:yes;resizable:no;”);

}

</script>

———- javascript script ———

================================

preivew.php

================================

<script type = “text/javascript”>

var edit = window.dialogArguments;
var page_name=edit.pagename;

document.write(edit.show);

</script>

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s