Dear All:
I have used a parent page to open fckeditor(son page). Then the son page return the HTML text
to parent page. It works well on IE but the fckeditor doesn't show on Firefox.(Just show two button)
May be it have some problem with javascript.
I use alert() in the fckeditor.js, but it doesn't run.(it runs on IE).
Does some one meet the same ploblem?
My html is like this:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>FCKeditor - Sample</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="robots" content="noindex, nofollow" />
<link href="editor.css" rel="stylesheet" type="text/css" />
<script type="text/javascript">
var loc = location.href;
var index = loc.indexOf("itemName");
var itemName = loc.substring(index).split("=")[1];
function confirm() {
var oEditor = FCKeditorAPI.GetInstance('FCKeditor1');
var content = oEditor.GetXHTML();
eval("window.opener.blankForm." + itemName + ".value=content;");
if(content.length > 0){
eval("window.opener.blankForm." + itemName + "KeepPattern.checked='true';");
//window.opener.blankForm.FreeHTMLKeepPattern.checked='true';
window.close();
}
</script>
<script type="text/javascript" src="fckeditor.js"></script>
</head>
<body>
<form name = "form1" action="" method="post" target="_blank">
<script type="text/javascript">
var oFCKeditor = new FCKeditor( 'FCKeditor1' ) ;
oFCKeditor.BasePath = '' ;
alert();
oFCKeditor.Value = eval("window.opener.blankForm." + itemName + ".value");
oFCKeditor.Create() ;
//-->
</script>
<br />
<input type="button" value="OK" onClick="confirm()"/>
<input type="button" value="キャンセル" onClick="script:window.close();"/>
</form>
</body>
</html>
Mon, 06/25/2007 - 22:00
#1
RE: fckeditor doesn't show on Firefox
Anyway it looks quite strange to use eval instead of something cleaner as window.opener.getElementById(itemName).value (as long as you cared to properly id the form elements)
RE: fckeditor doesn't show on Firefox
I use window.opener.getElementById(itemName) instead of eval()
and it's works well.It also need add "ID".