Issue with frames and using javascript to load content

Hello, everyone,

I’ve got a project (inherited) that uses frames (not Iframe… just plain frame) that is giving me fits.

This works great in development (Windows), but totally breaks in production (currently Linux). Cross-browser (it fails in all of them.)

Here is the main page:


<html>[INDENT]<head>[/INDENT]
[INDENT=2]<title>Project Title</title>
[/INDENT]
[INDENT]</head>
<frameset cols="400,*">[/INDENT]
[INDENT=2]<iframe src="index_frm.cfm" name="indexFrame" />
<iframe src="display.cfm" name="dispFrame" />
[/INDENT]
[INDENT]</frameset>
<body>

</body>
[/INDENT]
</html>

index_frm.cfm (indexFrame) has many things, but the relative thing is that I have a table that contains one row, that one row has four cells. Each cell has an onclick property that calls a js function that will load content in dispFrame.


<script type="text/javascript">[INDENT]function displayThis(pg){
[/INDENT]
[INDENT=2]parent.frames['dispFrame'].location = 'folder/' + pg;
[/INDENT]
[INDENT]}
[/INDENT]
</script>
<table>[INDENT]<tr>[/INDENT]
[INDENT=2]<td onclick="displayThis('pageone.cfm');">One</td>
<td onclick="displayThis('pagetwo.cfm');">Two</td>
<td onclick="displayThis('pagethree.cfm');">Three</td>
<td onclick="displayThis('pagefour.cfm');">Four</td>
[/INDENT]
[INDENT]</tr>[/INDENT]
</table>

When I click on any of the cells, the display frame will forever redirect (at least, I think it is… that’s how it’s behaving) and never load the page.

Thank you,

:slight_smile:

With my testing on Chrome, the frameset fails to show anything with your above code. This is because you have used iframe. The frame tags should be used there instead of iframe.

After making that change, things seem to work well in both Chrome and Internet Explorer.

Sorry… was tired when I typed that (can’t copy/paste from dev to internet… dev environment is isolated from internet). It’s not actually <iframe>, it’s <frame>. X)

I did, eventually, figure it out, but it took many, many, many, many attempts to hit “Esc” before the page started redirecting, but as it turned out the person who publishes to the production environment didn’t keep the folder structure from the zip file I sent, so ALL the files went into the root directory. Since the specific file couldn’t be found, the error trapping redirects to a “not_found.htm” page. Well… it couldn’t find the “not_found.htm” page, so it redirected to the “not_found.htm” page… and so on, and so on… sigh… SMH.

Thank you for your time.

V/r,

:slight_smile: