[eluser]Isos[/eluser]
Hi, the title tells it in short, and here the explanation:
I am using prototype for Ajax. Loading by a click 1 page (controller) into another.
in the opened page view
Code:
<form action="" method="post" name="report_form" id="report_form" >
<input type="submit" style='width:200px' name="report_button" value="Report" id="report_button" />
</form>
<div style="display:none;" id="display_textarea"></div>
Inside DIV the other page should be loaded:
Now the javascript that defines the Ajax object is:
Code:
window.onload = function () {
$('report_button').onclick = function () {
mail_report();
return false;
}
}
function mail_report() {
new Ajax.Updater ('display_textarea', report_url, {method:'post', postBody:'user_id='+$F('user_id')});
new Effect.Appear('display_textarea');
}
// report_url : is the URL to the controller that has the mail view
The view page of the controller that is going to be loaded is :
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=UTF8" />
<link rel="stylesheet" href="<?=base_url();?>css/style.css" type="text/css" />
<title><?=$page_title;?></title>
tinyMCE.init({
mode : "textareas",
theme : "simple"
});
</head>
<body>
<!-- CSS Style doesn't work when calling the page with the ajax httprequest.
<!-- Some form with textarea goes here, textarea doesn't appear with the javascript editor loaded when calling the page with the ajax httprequest.-->
</body>
</html>
So actually what I want to say, that this page, if refering to it directly, the tiny_mce (javascript textarea editor) and css work fine, but when loading it using ajax it doesn't work!
Anyone knows why? Is it a codeigniter problem? or it's Ajax?
Thanks.