Share the joy
Today, I tried ckeditor function. But the window.opener.CKEDITOR.tools.callFunction always doesn’t work. I found out it works in IE, but not in chrome. It’s weird. After hours research, I put it in tomcat server, and started tomcat server, it works. So the conclustion is that window.operner only works in server, but not in local machine.
editor.html:
- <html>
- <head>
- <script src=”./ckeditor/ckeditor.js”></script>
- <script type=”text/javascript”>
- </script>
- </head>
- <body>
- <form method=”post”>
- <textarea name=”content”>aaa</textarea>
- </form>
- <script language=”javascript” type=”text/javascript”>
- CKEDITOR.replace( ‘content’, {
- filebrowserBrowseUrl: ‘browser.html/browse.php’,
- filebrowserUploadUrl: ‘browser.html/upload.php’,
- filebrowserImageBrowseUrl: ‘browser.html?type=Images’,
- filebrowserImageUploadUrl: ‘browser.html/upload.php?type=Images’
- });
- CKEDITOR.config.width = 850;
- CKEDITOR.config.height = 300;
- </script>
- <input type=”button” onClick=”CKEDITOR.tools.callFunction(1, ‘abc.html’)” value=”setUrl”>
- </body>
- </html>
browser.html:
- <html>
- <head>
- <script type=”text/javascript”>
- function sendback(){
- window.opener.CKEDITOR.tools.callFunction(1, ‘abc.html’);
- }
- </script>
- </head>
- <body>
- <form method=”post”>
- <textarea name=”content”>aaa</textarea>
- </form>
- <input type=”button” value=”send back” onClick=”sendback();”/>
- </body>
- </html>