• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
tinymce.js source

hello guys,
i am new to codeigniter, and i have some trouble installing tinymce in my website.
at the beginning, i tried to work on localhost, and the tinymce work well...

i am using a helper (name is : a_helper.php) to integrate the tinymce into the view page,
which code looks like this :

if (!defined('BASEPATH')) exit('No direct script access allowed');
function initialize_tinymce()
$tinymce = <- script type="text/javascript" src="http://localhost/js/tinymce/tiny_mce.js"><- /script ->
<- script type="text/javascript" ->
theme : "advanced",
mode : "textareas",
theme_advanced_toolbar_location : "top",
convert_urls : false,
height: 300,
<- /script ->';
return $tinymce;

the controller was :
class controlphoto extends CI_Controller
  function _construct()
  function index()
   $data['watermark'] = $this->watermark->get_data();
   $data['category'] = $this->category->get_data();

and the view was :

&lt;meta content="text/html; charset=utf-8" http-equiv="Content-Type" /&gt;


&lt;?php echo initialize_tinymce();?&gt;

&lt;body role="application"&gt;
&lt;form method="post" action="/gorga-12/storephoto" enctype="multipart/form-data"&gt;

&lt;!--some form element !--&gt;
Description : &lt;textarea&gt;/textarea>
&lt;!--some form element !--&gt;

everything went well, and the tinymce works just fine, but the trouble comes up when i tried to upload the site into my online webserver.

i already change the code in a_helper.php into something like this :

$tinymce = '<- script type="text/javascript" src="http://my_website_name/js/tinymce/tiny_mce.js" ->
//the rest of the code

but the tinymce just can't work. i think it's because the tiny_mce.js can't be located properly.

anybody can help me?
i also tried to use the base_url() from url helper, and make the source something like this:

$tinymce = '<- script type="text/javascript" src="http://'. base_url() .' js/tinymce/tiny_mce.js" ->
//the rest of the code

with my base url set up as http://my_website_name/ at config.

also i used the autoload.php in config to load my a_helper.php,

can anybody please tell me what went wrong Sad

Well I'm new too but I'm not having trouble loading JS... But your use of base_url() seems wrong. I think it should be just:

base_url() js/tinymce/tiny_mce.js

IE for me base_url() contains all of the required HTTP prefixing. Also in your config.php have you defined $config['base_url']? This should be the reference to your site as in:

$config['base_url'] = 'http://www.mysite.com/';

&lt;?php echo base_url('js/tinymce/tiny_mce.js'); ?&gt;

thank you all, my problem solved,
it was just like insiteFX said, i use

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.