Javascript – ExecWB Print Preview Sometimes shows blank pages


This is a weird one. I am using the ExecWB method to create a PrintPreview window. Most of the time the print preview appears correctly. But sometimes it shows a blank page and that is all. Has anyone seen this before? The problem appears to be isolated to IE6. The problem is very hit and miss so it is difficult to determine what is going wrong.

 function onBodyLoad() {
    if (document.getElementById("contentPanel") != null) {
        var editCloseCell = document.getElementById('editCloseCell'); = "hidden";

        var OLECMDID = 7; // 7 == Print Preview
        var PROMPT = 1; // 2 == DONTPROMPTUSER

        document.getElementById('webBrowser').ExecWB(OLECMDID, PROMPT); = "visible";

The 'webBroswer' element is an object. The contents of the control seem to be displaying correctly. Could it be that the execWB method is being called before the control is populated??

Any insite on this would be helpful.


Best Solution

The problem appears to be JQuery.. believe it or not. On the same page where I am using the ExecWB() method I am also including the JQuery library to do some non-related POSTS to my webservice. I tried removing the JQuery from this page and it seems to have fixed the issue. My first thought was that there must be some conflict with the $. So I included the jQuery.noConflicts() and changed my POST method to jQuery.Ajax. The same issue arises. So I reluctantly had to remove my JQuery reference and refactor the Ajax call. IE6 is not cool... not cool at all.