troubleshooting Question

Richedit bug with SSL enabled sites

Avatar of ap_sajith
ap_sajith asked on
JavaScript
8 Comments1 Solution2312 ViewsLast Modified:
So here is the issue: When I try and access a page with the RichEdit component over SSL, the annoying "This page contains both secure and non secure items" message.

I know that the IFrame without the src attribute is causing the issue. So I tried giving an src attribute to the IFrame, pointing it to "blank.htm". Now the real problem starts. For some reason I get a permission denied error on the d.close() line within the richedit.js file.

Here is the code that I am using:
- RTE.asp
=============================================
<IFRAME ID="edit" CLASS="richEdit" usebr="true"  oneditinit="editInited(this)" STYLE="padding-top: 0px; width: 500; height: 200; border: 0px inset;" TABINDEX="4" src="blank.htm">
    <BODY TOPMARGIN="0" LEFTMARGIN="0" STYLE="color: black; background: white;font: 11px verdana;">
     
    </BODY>
   </IFRAME>
   
   <SCRIPT TYPE="text/javascript">

   function editInited(edit) {
      edit.frameWindow.document.body.style.color = "black";
      //** PASS THE VALUE FROM THE HIDDEN VARIABLE ON REFRESH **
      edit.frameWindow.document.body.innerHTML=window.document.all.txtDescription.value;
   }

   </SCRIPT>
===============================================

- RichEdit.js
===============================================
function initRichEdit(el) {
 if (el.id) { // needs an id to be accessible in the frames collection
  el.frameWindow = document.frames[el.id];
  if (el.value == null)
   el.value = el.innerHTML;
 
  if ( el.value.replace(/\s/g, "") == "" )
   el.value =  "<html>\n" +"<head>\n<title></title>\n</head>\n<body>\n</body>\n</html>";
  var d = el.frameWindow.document;
  d.designMode = "On";
  el.src = "blank.htm";
  d.open();
  d.write(el.value);
  d.close();//==>this is where I get the permission denied error

Thanks in advance for your suggestions. Please let me know if you need to see more of the code.

Cheers!
Sajit
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 8 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 8 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros