pasayten

We have a series of GIS mapping applications that run using ESRI's ArcIMS software with a javascript based html viewer.

We use a series of frames on a single page to display the base map, legend, table of contents, and an overview map. The applications have been running for about 4 years without any major browser issues.

However, the document object coding that we use to update and switch the overview images does not work in IE7:

<SCRIPT LANGUAGE=JAVASCRIPT><!--

...
parent.OverviewFrame.document.images['ovImage'].src = 'image.gif';
...

//--></SCRIPT>

Anybody know how to get this working again

Thanks!

Pasayten




Re: Internet Explorer Web Development IE7 and changing an image in a different frame

Kun Cong - MSFT

Is this image located on disk It is possibly blocked by a security feature of IE7. In IE7, when you want to load an image from local machine from a zone other than local machine, this operation will be blocked.

You can try to disable this feature by adding FEATURE_BLOCK_LMZ_IMG key in registry.

http://msdn.microsoft.com/library/default.asp url=/workshop/essentials/whatsnew/whatsnew_70_sec.asp





Re: Internet Explorer Web Development IE7 and changing an image in a different frame

pasayten

Kun,

Thanks for the reply, but all images come from the same server... In fact, all pages, frames, images... come from the same web server.

In IE 7, it seems that the object:

parent.OverviewFrame.document.images('ovImage')

does not exist and is undefined. It works fine in earlier versions of IE.

Have any other ideas

Thanks!

pasayten





Re: Internet Explorer Web Development IE7 and changing an image in a different frame

Kun Cong - MSFT

I just copied your script and it works well on my machine. Can you check whether following files work on your side

Main.htm

<frameset cols="50%,*" >
<frame src="F1.htm" />
<frame src="F2.htm" id="OverviewFrame" />
</frameset>

F1.htm

<body>
<input type=button onclick="parent.OverviewFrame.document.images['ovImage'].src = 'new.png';" />
</body>


F2.htm

<body>
<img id="ovImage" src="original.jpg" />
</body>





Re: Internet Explorer Web Development IE7 and changing an image in a different frame

pasayten

Kun,

I attached example code for what I am dealing with... There seems to be differences between IE 5/6 and IE7 as when/if the parent.OverviewFrame.document.images['ovImage2'] is defined and it broke a lot of our mapping programs.

Here is a link to the example: http://dory.airfire.org/website/vcis_ak/test_ie7.htm

Here is a link to our production main page: http://www.blueskyrains.org

and one of the mapping applications: http://marlin.airfire.org/website/blueprj

In IE 7, the overview map does not display in the upper right corner.

If you have any idea of a work around or can point me somewhere, I would surely appreachiate it!

Thanks,

pasayten

aka Ray Peterson

(pasayten@yahoo.com)

test_ie7.htm

<html>
<head>
<SCRIPT TYPE="text/javascript" LANGUAGE="JavaScript">
//alert('In Main');
</SCRIPT>
</head>
<frameset cols="50%,*" >
<frame src="f1.htm" />
<frame src="f2.htm" id="OverviewFrame" />
</frameset>
<noframes>
<body>
<p>
</body>
</noframes>
</html>

f1.htm

<html>
<head>
Check f1 head section for images stuff:<br>
<SCRIPT TYPE="text/javascript" LANGUAGE="JavaScript">
document.write("f1.htm head section javascript...<br>");
var img_switch;
img_switch = parent.OverviewFrame.document.images['ovImage2'];
document.write("Checking f1.htm head section for parent.OverviewFrame.document.images stuff...<br>");
if (img_switch==null) {
document.write("...images['ovImage2'] is null/undefined, but actually not needed yet<br>");
} else {
document.write("...images['ovImage2'] is defined, .src= " + img_switch.src + "<br>");
}
</SCRIPT>
</head>
<body>
First button has second image hard coded to onclick stuff<br>
<input type=button onclick="parent.OverviewFrame.document.images['ovImage'].src =
'http://dory.airfire.org/website/vcis_ak/images/zoomin_2.gif';" />
<br>Now do a second button with javascript...<br>
<SCRIPT TYPE="text/javascript" LANGUAGE="JavaScript">
document.write("f1.htm body section javascript...<br>");
img_switch = parent.OverviewFrame.document.images['ovImage2'];
var x;
if (img_switch==null) {
document.write("<b>Sorry, this is IE version " + navigator.appVersion + "<br>...images['ovImage2'] is undefined</b><br>");
} else {
document.write("<b>IE version " + navigator.appVersion + "<br>...images['ovImage2']is defined, .src will change on click...</b><br>");
x = 'http://dory.airfire.org/website/vcis_ak/images/zoomin_2.gif';
}
var z;
z = '<input type=button onclick="parent.OverviewFrame.document.images[\'ovImage2\'].src = \'';
z += x;
z += '\';" />';
document.write(z);
</SCRIPT>
<br><b>Note: </b>First button is hard coded to switch to darker image<br>
Second button uses javascript to set second image<br>
Pressing second button in IE 7 sets image to undefined,
but IE <=6 does and I do not know why.<br>');
</body>
</html>

f2.htm

<html>
<body>
Image for button 1:
<img id="ovImage" name="ovImage" src="http://dory.airfire.org/website/vcis_ak/images/zoomin_1.gif" />
<p>
Image for button 2
<img id="ovImage2" name="ovImage2" src="http://dory.airfire.org/website/vcis_ak/images/zoomin_1.gif" />
</body>
</html>





Re: Internet Explorer Web Development IE7 and changing an image in a different frame

Kun Cong - MSFT

pasayten ,

This should be due to the timing issue. When F1 is initializing the var x, F2 is possible not loaded completely, so img_switch might be null. There is no guarantee on the loading sequence of the two frames.

A better design should be checking img_switch each time user clicking the button.

BTW, your page has the same issue on IE6 on my machine as on IE7.





Re: Internet Explorer Web Development IE7 and changing an image in a different frame

pasayten

Kun,

Thanks for the response that leads me in the right direction... I will define variable earlier in the main module and check for valid values later on in the frame modules... If not valid, I can put in a workaround which is better anyway, especially for future browser versions. There is a lot of javascript that gets sent to the client machine which most likely is causing the frame loading issues... It just had never happened before.

BTW, even thought IE 6 does not work on my little test scripts, it does on our mapping application on our machines. Once again probably due to loading and timing issues.

Thanks again for your help!

pasayten