nicedit tool works fine on my localhost, but when uploading the site to the cloud it doen't work

757 Views Asked by At

I have installed Nicedit tool to convert <textarea> into richtext box on my pages by adding the following code as per their instructions on their website:

<script src="http://js.nicedit.com/nicEdit-latest.js" type="text/javascript"></script>
<script type="text/javascript">bkLib.onDomLoaded(nicEditors.allTextAreas);</script>

However textareas got convereted (Nicedit worked fine) ONLY on my localhost Xampp, but when i uploaded the pages online, everything works fine except for the Nicedit, it doesn't work at all.

Please note that no error messages appeared, nor with textareas the issue is that textareas appear plain just like the standard, like if I didn't install the Nicedit.

Note: I have tried the following code as well since I've seen it as an example on their page, but it doesn't work also.

  <script type="text/javascript" src="http://js.nicedit.com/nicEdit-latest.js"></script> <script type="text/javascript">
//<![CDATA[
        bkLib.onDomLoaded(function() { nicEditors.allTextAreas() });
  //]]>
  </script>.

PHP version used online is 5.6, if this would be useful info.

1

There are 1 best solutions below

0
Mostafa On

Since I couldn't find the reason to fix the issue that I have, I've found another tool created by the same programmer of Nicedit, it's name is CKeditor. it's really nice, however browsing the website would take you into the direction of downloading and using JS code from your site, but I have found the following way to let it work as CDN.

First in the <head></head> tags copy the following:

<script src="https://cdn.ckeditor.com/4.7.1/basic/ckeditor.js"></script>

then inside <body></body> copy this code (presuming text1 is the name arttibute for the <textarea> that you want to convert.

<script>
        CKEDITOR.replace( 'text1');
</script>

Hope this would be helpful for everyone.