to the embedded IE MFC control for rendering.
This app was developed with IE6 and works fine in that environment.
We recently upgraded some of our machines to IE7 and now when we run and the
page renders in the embedded IE window, we get script errors. The errors we
see are shown below.
1) Line: 1, Error: Invalid character
2) Line: 9, Error: 'CalendarPopup' is undefined
The first error is a bit confusing, since if you view the source the first
line is just <html>. I thought perhaps it wanted a valid <!DOCTYPE ...>
header so I added that, but the error was still there.
The second error is odd as well, since the CalendarPopup is brought in by
importing a .js file using something like the below. Under IE6 this worked
fine and pulled in the definition.
=> Any idea how to correct these script errors?
=> Is there any way to uninstall IE7 and revert back to IE6? I can't seem
to find any way to uninstall IE7; if I can't fix these errors, I'll need to move back to IE6
Looks like uninstalling IE7 is fairly easy. I was looking in the wrong place. Its listed under "Windows Internet Explorer 7" in the Add/Remove Programs control panel. After uninstalling, our app works again.
Anyway, we're going to have to eventually fix these script errors. Any ideas?
Is the source a local file ?
Did you try to access the file with an url, for example src="http://domain/path/CalendarPopu.js" ?
Or maybe you can try a relative link, with the js file in the same folder as the geerated web page.
I too am having these errors.
There appears to be a max script length that IE7 will read.
Like you, mine worked with IE6.
Luckily it works with firefox 2 so at least i have a work around.
I also have a situation where a script generates an error in the browser embedded within our app, but not in stand-alone IE7 where it is ok. It works fine in the embedded situation on systems with older versions of IE. We have a situation where a script is trying to close a window that has already been closed by the user. No errors occur except in the case of the embedded browser control on IE7 systems, in which case a "permission denied" exception is being thrown. Surely there must be something I can configure in our C++ code to revert to the usual behaviour. Can anybody help - it would be prohibitively expensive to fix all our code locations to check whether the window has already closed, but I also fear other things might be affected too.
Test page follows:
var windowsToClose = new Array(); //for holding references to windows that need to be closed
while (windowsToClose.length > 0)
var WinObj = windowsToClose.pop();
// Permission denied scripting error on following line when invoke in
// embedded web browser on system with IE7
alert("Caught exception: " + excp.message);
alert("All Windows Closed");
The core problem with the window closing script in this page is that it relies on
a variable to track how many winows have been opened. When a point in the code calls
on the script to close a window, it does not look to see if the window is still
open, instead it blindly attempts to close the window regardless of whether or not
the window is indeed open.</p>
Under Internet Explorer 6 no error was presented to the user when the code attempted
to close a window that was not present. Under Internet Explorer 7 each time a window
that is not open has a "close" fuction fun on it, there will be a IE script
To simulate the error, do the following with IE7 installed:</p>
<li><a href=openWindow();">Click here to open a pop-up window.</a>
<li>Close it manually.</li>
<li><a href=closeAllWindows();">Click here to once again close all open
<li>You should have had a script error occur when you performed the previous step. If
you didn't see a script error, did you see the dialog saying "All Windows Closed"?.
If you didn't see either message, there was a script error, but IE didn't display
I think your issue should be the same one I discussed in this thread:
If your app uses IHTMLDocument2::write() method to write a document with external script file reference, it is likely falling into this issue. I provided a possible solution there.