Hi
David said:
I'm guessing that what the problem with Opera is having an iframe in an iframe.
I would not say that. [tt]iframe[/tt] inside [tt]iframe[/tt] is technically correct and browsers have nothing against it. But it is conceptually wrong and hard to debug when [tt]iframe[/tt] contents are manipulated with JavaScript.
David said:
I did not know the code I was using is obfuscated.
Well, let us make a small trip :
[ul]
[li]open
in a browser[/li]
[li]open the View Source window[/li]
[li]search for "cookieEnabled" in the source code[/li]
[li]you will find it in this piece of JavaScript code :
Code:
[small]setTimeout([highlight]'HtmlControlJS.loadFrame\x28
\x27ctl00_IWS_WH_CPH_Content_HtmlControl1\x27, \x27\x5cx3c\x5cx21DOCTYPE
html PUBLIC \x5cx22-\x5cx2f\x5cx2fW3C\x5cx2f\x5cx2fDTD XHTML 1.0
Transitional\x5cx2f\x5cx2fEN\x5cx22 \x5cx22http\x5cx3a\x5cx2f
\x5cx2f[URL unfurl="true"]www.w3.org\x5cx2fTR\x5cx2fxhtml1\x5cx2fDTD\x5cx2fxhtml1-[/URL]
transitional.dtd\x5cx22\x5cx3e\x5cx0d\x5cx0a\x5cx3chtml xmlns\x5cx3d
\x5cx22http\x5cx3a\x5cx2f\x5cx2f[URL unfurl="true"]www.w3.org\x5cx2f1999\x5cx2fxhtml\x5cx22[/URL]
\x5cx3e\x5cx0d\x5cx0a\x5cx3chead\x5cx3e\x5cx0d\x5cx0a\x5cx3cmeta
http-equiv\x5cx3d\x5cx22Content-Type\x5cx22 content\x5cx3d\x5cx22text
\x5cx2fhtml\x5cx3b charset\x5cx3dutf-8\x5cx22 \x5cx2f\x5cx3e\x5cx0d\x5cx0a
\x5cx3ctitle\x5cx3eArroyo Grande homes \x5cx26 land for sale multiple MLS
listings David Norwood central coast real estate California\x5cx3c
\x5cx2ftitle\x5cx3e\x5cx0d\x5cx0a\x5cx3c\x5cx2fhead\x5cx3e\x5cx0d\x5cx0a
\x5cx3cscript type\x5cx3d\x5cx22text\x5cx2fjavascript\x5cx22\x5cx3e\x5cx0d
\x5cx0aif \x5cx28\x5cx21navigator.cookieEnabled\x5cx29 \x5cx7b\x5cx0d
\x5cx0a document.location \x5cx3d \x5cx22http\x5cx3a\x5cx2f
\x5cx2fdnorwood.com\x5cx2fNo_Cookies_Enabled.aspx\x5cx22\x5cx0d\x5cx0a
\x5cx7d\x5cx0d\x5cx0a\x5cx3c\x5cx2fscript\x5cx3e\x5cx0d\x5cx0a
\x5cx3ciframe src\x5cx3d\x5cx22http\x5cx3a\x5cx2f
\x5cx2fsearchlax.rapmls.com\x5cx2fClientPortal.aspx
\x5cx3fTJhkRvbuacuchF1EIpHbjYciBR70iW0BLaQkyDkwubiuOlt9UsvKHZN1Yu5eYluwbGWt
L9CJCFirXSubZnmw0Ta5yXBPrlVfwgCMOl6CmYQpxYrVCOR6QVZ8FoRb8rN3ShIU1UorbNedrWn
msvCibGHvKFmhZB80KCEQTiKr\x5cx2fVTRrF2LCaIGEUjjQiOULQPVPMm16JKe7ArgVHiFP5Sv
tXCESfnWx\x5cx2fhrnQt5JDzV4j6VG7Z\x5cx2fPxYiotyZqoETZH\x5cx2bO\x5cx26hidMLS
\x5cx3dCCRM\x5cx26hidEntryPoint\x5cx3dMW1\x5cx26KeyRid\x5cx3d1\x5cx22
width\x5cx3d\x5cx22843\x5cx22 height\x5cx3d\x5cx225025\x5cx22\x5cx3e\x5cx3c
\x5cx2fiframe\x5cx3e\x5cx0d\x5cx0a\x5cx3cbody\x5cx3e\x5cx0d\x5cx0a\x5cx3c
\x5cx2fbody\x5cx3e\x5cx0d\x5cx0a\x5cx3c\x5cx2fhtml\x5cx3e\x5cx0d\x5cx0a
\x27,1033, \x272.02.2715.0\x27\x29\x3b'[/highlight], 0);[/small]
[/li]
[li]cut out [tt]setTimeout()[/tt]'s first parameter ( highlighted above with yellow )[/li]
[li]use that string as parameter of an [tt]alert()[/tt] call[/li]
[li]the [tt]alert()[/tt] will say this :
Code:
[small]HtmlControlJS.loadFrame('ctl00_IWS_WH_CPH_Content_HtmlControl1', [highlight pink]'\x3c\x21DOCTYPE html PUBLIC \x22-\x2f\x2fW3C\x2f\x2fDTD
XHTML 1.0 Transitional\x2f\x2fEN\x22 \x22http\x3a\x2f\x2f[URL unfurl="true"]www.w3.org\x2fTR[/URL]
\x2fxhtml1\x2fDTD\x2fxhtml1-transitional.dtd\x22\x3e\x0d\x0a\x3chtml
xmlns\x3d\x22http\x3a\x2f\x2f[URL unfurl="true"]www.w3.org\x2f1999\x2fxhtml\x22\x3e\x0d\x0a[/URL]
\x3chead\x3e\x0d\x0a\x3cmeta http-equiv\x3d\x22Content-Type\x22 content\x3d
\x22text\x2fhtml\x3b charset\x3dutf-8\x22 \x2f\x3e\x0d\x0a\x3ctitle
\x3eArroyo Grande homes \x26 land for sale multiple MLS listings David
Norwood central coast real estate California\x3c\x2ftitle\x3e\x0d\x0a\x3c
\x2fhead\x3e\x0d\x0a\x3cscript type\x3d\x22text\x2fjavascript\x22\x3e
\x0d\x0aif \x28\x21navigator.cookieEnabled\x29 \x7b\x0d\x0a
document.location \x3d \x22http\x3a\x2f\x2fdnorwood.com
\x2fNo_Cookies_Enabled.aspx\x22\x0d\x0a\x7d\x0d\x0a\x3c\x2fscript\x3e\x0d
\x0a\x3ciframe src\x3d\x22http\x3a\x2f\x2fsearchlax.rapmls.com
\x2fClientPortal.aspx
\x3fTJhkRvbuacuchF1EIpHbjYciBR70iW0BLaQkyDkwubiuOlt9UsvKHZN1Yu5eYluwbGWtL9C
JCFirXSubZnmw0Ta5yXBPrlVfwgCMOl6CmYQpxYrVCOR6QVZ8FoRb8rN3ShIU1UorbNedrWnmsv
CibGHvKFmhZB80KCEQTiKr\x2fVTRrF2LCaIGEUjjQiOULQPVPMm16JKe7ArgVHiFP5SvtXCESf
nWx\x2fhrnQt5JDzV4j6VG7Z\x2fPxYiotyZqoETZH\x2bO\x26hidMLS\x3dCCRM
\x26hidEntryPoint\x3dMW1\x26KeyRid\x3d1\x22 width\x3d\x22843\x22 height\x3d
\x225025\x22\x3e\x3c\x2fiframe\x3e\x0d\x0a\x3cbody\x3e\x0d\x0a\x3c\x2fbody
\x3e\x0d\x0a\x3c\x2fhtml\x3e\x0d\x0a'[/highlight],1033, '2.02.2715.0');
[/small]
[/li]
[li]cut out [tt]loadFrame()[/tt]'s second parameter ( highlighted above with pink )[/li]
[li]use that string as parameter of an [tt]alert()[/tt] call[/li]
[li]the [tt]alert()[/tt] will say this :
Code:
[small]<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "[URL unfurl="true"]http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">[/URL]
<html xmlns="[URL unfurl="true"]http://www.w3.org/1999/xhtml">[/URL]
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Arroyo Grande homes & land for sale multiple MLS listings David Norwood central coast real estate California</title>
</head>
<script type="text/javascript">
if (!navigator.cookieEnabled) {
document.location = "[URL unfurl="true"]http://dnorwood.com/No_Cookies_Enabled.aspx"[/URL]
}
</script>
<iframe src="[URL unfurl="true"]http://searchlax.rapmls.com[/URL]
/ClientPortal.aspx?TJhkRvbuacuchF1EIpHbjYciBR70iW0BLaQkyDkwubiuOlt9UsvKHZN1
Yu5eYluwbGWtL9CJCFirXSubZnmw0Ta5yXBPrlVfwgCMOl6CmYQpxYrVCOR6QVZ8FoRb8rN3ShI
U1UorbNedrWnmsvCibGHvKFmhZB80KCEQTiKr/VTRrF2LCaIGEUjjQiOULQPVPMm16JKe7ArgVH
iFP5SvtXCESfnWx/hrnQt5JDzV4j6VG7Z/PxYiotyZqoETZH+O&hidMLS=CCRM&
hidEntryPoint=MW1&KeyRid=1" width="843" height="5025"></iframe>
<body>
</body>
</html>[/small]
[/li]
[/ul]
And finally we got some clear code. That looks correct enough to be functional. ( Ignoring the fact that the [tt]script[/tt] and [tt]iframe[/tt] tags are
between the [tt]head[/tt] and [tt]body[/tt] sections, in the middle of nothing. )
But let us take a look at what happens with that code. It was passed as the second parameter to the HtmlControlJS.loadFrame() method, which looks like this :
Code:
[small] loadFrame[teal]:[/teal] [b]function[/b][teal]([/teal]id[teal],[/teal] content[teal],[/teal]
lcid[teal],[/teal] build[teal])[/teal]
[teal]{[/teal]
[b]if[/b] [teal](![/teal] HtmlControlJS[teal].[/teal]loadedFrames[teal][[/teal]id[teal]])[/teal] [gray]// If it has already been loaded, then don't reload it.[/gray]
[teal]{[/teal]
[b]if[/b] [teal]([/teal]content [teal]==[/teal] [b]null[/b][teal])[/teal]
[teal]{[/teal]
content [teal]=[/teal] HtmlControlJS[teal].[/teal]content[teal][[/teal]id[teal]];[/teal]
[teal]}[/teal]
[b]else[/b]
[teal]{[/teal]
HtmlControlJS[teal].[/teal]content[teal][[/teal]id[teal]][/teal] [teal]=[/teal] content[teal];[/teal]
[teal]}[/teal]
[b]try[/b]
[teal]{[/teal]
[b]var[/b] iframe [teal]=[/teal] window[teal].[/teal]document[teal].[/teal][COLOR=darkgoldenrod]getElementById[/color][teal]([/teal]id[teal]);[/teal]
[b]if[/b] [teal](([/teal]iframe[teal].[/teal]style[teal].[/teal]height [teal]==[/teal] [green][i]'0px'[/i][/green][teal])[/teal] [teal]||[/teal] [teal]([/teal]iframe[teal].[/teal]style[teal].[/teal]height [teal]==[/teal] [green][i]'[/i][/green][teal])[/teal] [teal]||[/teal] [teal]([/teal]iframe[teal].[/teal]style[teal].[/teal]height [teal]==[/teal] [green][i]'auto'[/i][/green][teal]))[/teal]
[teal]{[/teal]
HtmlControlJS[teal].[/teal]resizeFrames[teal][[/teal]id[teal]][/teal] [teal]=[/teal] [b]true[/b][teal];[/teal]
[teal]}[/teal]
[b]var[/b] iframeDoc [teal]=[/teal] [teal]([/teal]iframe[teal].[/teal]contentWindow [teal]||[/teal] iframe[teal].[/teal]contentDocument[teal]);[/teal]
[b]if[/b] [teal]([/teal]iframeDoc[teal].[/teal]document[teal])[/teal] iframeDoc [teal]=[/teal] iframeDoc[teal].[/teal]document[teal];[/teal] [gray]// if we have a window ref get a doc ref[/gray]
HtmlControlJS[teal].[/teal][COLOR=
darkgoldenrod]writeDocument[/color][teal]([/teal]iframeDoc[teal],[/teal]
content[teal],[/teal] lcid[teal],[/teal] build[teal]);[/teal]
[COLOR=darkgoldenrod]setTimeout[/color][teal]([/teal][green][i]"HtmlControlJS.resizeFrame('"[/i][/green][teal]+[/teal]id[teal]+[/teal][green][i]"');"[/i][/green][teal],[/teal] [purple]0[/purple][teal]);[/teal] [gray]// delay reizeFrame() call to give FireFox a chance to load the dom.[/gray]
[teal]}[/teal]
[b]catch[/b][teal]([/teal]LoadException[teal])[/teal]
[teal]{[/teal]
[COLOR=darkgoldenrod]setTimeout[/color][teal]([/teal][green][i]"HtmlControlJS.loadFrame('"[/i][/green][teal]+[/teal]id[teal]+[/teal][green][i]"', null, "[/i][/green][teal]+[/teal]lcid[teal]+[/teal][green][i]", '"[/i][/green][teal]+[/teal]build[teal]+[/teal][green][i]"');"[/i][/green][teal],[/teal] [purple]5[/purple][teal]);[/teal]
[b]return[/b][teal];[/teal]
[teal]}[/teal]
HtmlControlJS[teal].[/teal]loadedFrames[teal][[/teal]id[teal]][/teal] [teal]=[/teal] [b]true[/b][teal];[/teal]
HtmlControlJS[teal].[/teal]content[teal][[/teal]id[teal]][/teal] [teal]=[/teal] [b]null[/b][teal];[/teal]
[gray]// Capture the window onResize event if this is the
first HTML control loaded.[/gray]
[gray]//[/gray]
[b]var[/b] size [teal]=[/teal] [purple]0[/purple][teal];[/teal]
[b]for[/b][teal]([/teal][b]var[/b] x [b]in[/b]
HtmlControlJS[teal].[/teal]loadedFrames[teal])[/teal]
[teal]{[/teal]
size[teal]++;[/teal]
[teal]}[/teal]
[b]if[/b] [teal]([/teal]size [teal]==[/teal] [purple]1[/purple][teal])[/teal]
[teal]{[/teal]
HtmlControlJS[teal].[/teal]oldOnResize [teal]=[/teal]
window[teal].[/teal]onresize[teal];[/teal]
window[teal].[/teal]onresize [teal]=[/teal]
HtmlControlJS[teal].[/teal]onResize[teal];[/teal]
[teal]}[/teal]
[teal]}[/teal]
[teal]}[/teal][teal],[/teal][/small]
So it is passed forward as the second parameter to
HtmlControlJS.writeDocument(), which looks like this :
Code:
[small] writeDocument[teal]:[/teal] [b]function[/b][teal]([/teal]doc[teal],[/teal] content[teal],[/teal]
lcid[teal],[/teal] build[teal])[/teal]
[teal]{[/teal]
doc[teal].[/teal][COLOR=darkgoldenrod]open[/color][teal]();[/teal]
doc[teal].[/teal][COLOR=darkgoldenrod]writeln[/color][teal]([/teal][green][i]'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"[URL unfurl="true"]http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">'[/URL][/i][/green][teal]);[/teal]
doc[teal].[/teal][COLOR=darkgoldenrod]writeln[/color][teal]([/teal][green][i]'<html xmlns="[URL unfurl="true"]http://www.w3.org/1999/xhtml">'[/URL][/i][/green][teal]);[/teal]
doc[teal].[/teal][COLOR=darkgoldenrod]writeln[/color][teal]([/teal][green][i]'<head>'[/i][/green][teal]);[/teal]
doc[teal].[/teal][COLOR=darkgoldenrod]writeln[/color][teal]([/teal][green][i]'<title>none</title>'[/i][/green][teal]);[/teal]
doc[teal].[/teal][COLOR=darkgoldenrod]writeln[/color][teal]([/teal][green][i]'<link type="text/css" rel="stylesheet" href="/_layouts/'[/i][/green] [teal]+[/teal] lcid [teal]+[/teal] [green][i]'/wh/stylesV2
/masterroot.css?b='[/i][/green][teal]+[/teal] build [teal]+[/teal][green][i]'" />'[/i][/green][teal]);[/teal]
doc[teal].[/teal][COLOR=darkgoldenrod]writeln[/color][teal]([/teal][green][i]'<link type="text/css" rel="stylesheet" href="theme.css" />'[/i][/green][teal]);[/teal] [gray]// This file is not cached, so no
versioning[/gray]
doc[teal].[/teal][COLOR=darkgoldenrod]writeln[/color][teal]([/teal][green][i]'<base target="_parent" />'[/i][/green][teal]);[/teal]
doc[teal].[/teal][COLOR=darkgoldenrod]writeln[/color][teal]([/teal][green][i]'</head>'[/i][/green][teal]);[/teal]
doc[teal].[/teal][COLOR=darkgoldenrod]writeln[/color][teal]([/teal][green][i]'<body class="MSC_Body" style="border: 0px none black; margin:
0px; padding: 0px; background-color: transparent;">'[/i][/green][teal]);[/teal]
doc[teal].[/teal][COLOR=darkgoldenrod]writeln[/color][teal]([/teal]content[teal]);[/teal]
doc[teal].[/teal][COLOR=darkgoldenrod]writeln[/color][teal]([/teal][green][i]'</body>'[/i][/green][teal]);[/teal]
doc[teal].[/teal][COLOR=darkgoldenrod]writeln[/color][teal]([/teal][green][i]'</html>'[/i][/green][teal]);[/teal]
doc[teal].[/teal][COLOR=darkgoldenrod]close[/color][teal]();[/teal]
[teal]}[/teal][/small]
As you can see, when written out content is placed in the body of a HTML document. But as we saw above, the content already contains an ( almost correct ) HTML document. So the resulted HTML will be anything, but not correct.
If you want the browser to do what
you want, you have to give the browser what
it expects : valid markup and code.
I hope the above explains why I consider this self-ball-kicking. Honestly, I would dump that code, together with the [tt]iframe[/tt]s. I have no idea how all this looks on the ASP side, but I consider it unmaintainable and would expect that any further modification/debugging will be a pain.
Feherke.