Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8960479
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T15:40:04+00:00 2026-06-15T15:40:04+00:00

I am working to make html files of a website editable using CKEditor. I

  • 0

I am working to make html files of a website editable using CKEditor. I want the user should be able to edit the code of any html file via the admin panel. For this purpose I am using the file_get_contents function which seems to work fine except the JavaScript code is not displayed as editable code in the editor. I have tried the fread function as well and it also displays all the contents of the file in editor but I am still unable to get the JavaScript code in the editor as editable code. Any help?

Here’s the code:

$contents = file_get_contents($_REQUEST['path']);
if(!$contents) die("Page not found");      
    $oFCKeditor = new FCKeditor('content') ;
    $oFCKeditor->BasePath = 'fckeditor/' ;
    $oFCKeditor->Width = '100%' ;
    $oFCKeditor->Height = '350' ; 
    if($mode == 'edit')$oFCKeditor->Value = stripslashes($contents);
    $oFCKeditor->Create() ; 
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T15:40:05+00:00Added an answer on June 15, 2026 at 3:40 pm

    CKEditor (formerly FCKeditor) is a WYSIWYG(What-You-See-Is-What-You-Get) editor. WYSIWYG Editors take all the html,css & javascript, execute/parse it & try to display the output. so that’s the reson Javascript code is not being shown in editor, as the editor is build to parse the javascript & display its output; instead of actual code.

    Now, If you want to work directly with code, than its output. there are two options:

    1. Use the “View Source” button & you should be able to see all the javascript along with other code.There won’t be any syntax highlighting but I this would work fine for small edits
    2. Use Source code editor: If you want proper syntax highlighting, you have to switch to a source code editor instead of WYSIWYG(What-You-See-Is-What-You-Get) editor. example of some source code editor
      • http://code.google.com/p/pagedown/ its the same editor that you see here on stackoverflow
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am working on a CSS/HTML submit form that I am going to make
I'm working on a little program to make my life easier when using Microsoft
I have added the lines to the web.config to make .html files handled by
The HTML below is what I'm working with. I want it to be in
I'm using cloudflare. My site is working good but not loading any images, css
I'm currently working on a web application that allows the user to upload files
Two questions in regards to a website I am working on... My website: http://thendesign.com/new/type.html
i am working to make a Android application that can upload and download data
I'm trying to make it working for quite some time,but just can't seem to
I'm trying and trying and can't make it working. I have a ul class=first

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.