I am trying to write a plugin that passes back html through the window.returnValue. It works in firefox but no in IE and Chrome. Can anybody point me in the right direction?
Plugin.js
Pop up page
Plugin.js
(function () { var a = { modes: { wysiwyg: 1 }, exec: function (editor) { var templateSelect = window.showModalDialog("/Admin/Editing/Templates.aspx", "TemplateSelect", "dialogWidth:550px;dialogHeight:500px;center:yes; resizable: yes; help: no"); //alert(templateSelect.markup + "here"); if (templateSelect != false && templateSelect != null) { if (templateSelect.markup != "") { //alert(templateSelect.markup); // get the text selected in the editor editor.insertHtml(templateSelect.markup); } } } }, b = 'fbisTemplates'; CKEDITOR.plugins.add(b, { init: function (editor) { editor.addCommand(b, a); editor.ui.addButton('fbisTemplates', { label: 'Templates', icon: this.path + 'images/template.png', command: b }); } }); })();
Pop up page
$(document).ready(function() { $('#Templates>ul>li').click(function(e) { var $markup = $(e.target).closest('li'); $markup.find('div.Filter').remove(); var result = $markup.html(); if (Request.QueryString('CKEditorFuncNum').Count != 0) { //called from fck so call its callback function window.opener.CKEDITOR.tools.callFunction('' + Request.QueryString('CKEditorFuncNum'), result); } else { //Not from fck so probably called by one of our editors //$.triggerParentEvent('pageSelect', result); //return url; window.returnValue = { markup: result }; } e.preventDefault(); window.close(); }); });