javascript - how to insert upload fileurl as image into ckeditor by jquery -
hey guys trying populate uploaded image ckeditor getting image outside of ckeditor. me set of codes below! many thanks!!
heres ck editor:
@html.textareafor(model => model.questioncontent, new { @id = "ckecontent" }) <script type="text/javascript"> ckeditor.replace( "ckecontent" ) window.onload = function () { var sbasepath = '@url.content("~/content/ckeditor/")'; var ofckeditor = new fckeditor( "ckecontent" ); ofckeditor.basepath = sbasepath; ofckeditor.height = 300; ofckeditor.replacetextarea(); }</script>
heres set of jquery call image
<script type="text/javascript"> $(function() { $("#browser").click(function() { var ckfinder = new ckfinder(); ckfinder.selectactionfunction = function ( fileurl ) { $( '#imagediv' ).html(''); var img = new image(); $( img ).attr( 'src', '' + fileurl ).appendto( $( '#imagediv' ) ).fadein(); $( img ).attr( 'width', '' + fileurl ) $( img ).attr( 'height', '' + fileurl ) }; ckfinder.popup(); }); });
Comments
Post a Comment