After viewing the JavaScript source code for Dijit, I thought that most likely the error was due to a "unsafe" rejection of the dynamically generated IFRAME. Note that there are two versions of the script file, the uncompressed one represents the original source (dijit.js.uncompressed.js), and the standard one (dijit.js) is compressed for optimal transfer time.
Since the uncompressed version is the most readable, I will describe my solution based on this. On line # 1023, the IFRAME is displayed in JavaScript:
if(dojo.isIE){ var html="<iframe src='javascript:\"\"'" + " style='position: absolute; left: 0px; top: 0px;" + "z-index: -1; filter:Alpha(Opacity=\"0\");'>"; iframe = dojo.doc.createElement(html); }else{...
What is the problem? IE does not know if src for IFRAME is "safe", so I replaced it with the following:
if(dojo.isIE){ var html="<iframe src='javascript:void(0);'" + " style='position: absolute; left: 0px; top: 0px;" + "z-index: -1; filter:Alpha(Opacity=\"0\");'>"; iframe = dojo.doc.createElement(html); }else{...
This is the most common issue with JavaScript and SSL tools in IE. Since IFRAMEs are used as spacers due to poor DIV overlay support, this problem is extremely common.
My first reloads of 5-10 pages are fine, but then a security error reappears. How is this possible? The same page is "secure" for 5 reloads, and then it is selected by IE as "unsafe" when loading for the 6th time.
As it turned out, there is also a background image that is set in the onload event for dijit.wai (line # 1325). It reads something like this:
div.style.cssText = 'border: 1px solid;' + 'border-color:red green;' + 'position: absolute;' + 'height: 5px;' + 'top: -999px;' + 'background-image: url("' + dojo.moduleUrl("dojo", "resources/blank.gif") + '");';
This will not work because the background-image tag does not contain HTTP. Despite the fact that the location is relative, IE7 does not know if it is protected, so a warning is issued.
In this particular case, this CSS is used to check for accessibility (A11y) in Dojo. Since this is not what my application will support, and since there are other common error problems with this method, I decided to remove everything in onload () for dijit.wai.
Things are good! No sporadic security issues when loading the page.