SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Addict bronze trophy WolfShade's Avatar
    Join Date
    Mar 2014
    Location
    St. Louis, MO, USA
    Posts
    334
    Mentioned
    9 Post(s)
    Tagged
    0 Thread(s)

    Unhappy 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:
    Code:
    <html>
    <head>
    <title>Project Title</title>
    </head> <frameset cols="400,*">
    <iframe src="index_frm.cfm" name="indexFrame" /> <iframe src="display.cfm" name="dispFrame" />
    </frameset> <body> </body>
    </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.
    Code:
    <script type="text/javascript">
    function displayThis(pg){
    parent.frames['dispFrame'].location = 'folder/' + pg;
    }
    </script> <table>
    <tr>
    <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>
    </tr>
    </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,

    ^_^

  2. #2
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,729
    Mentioned
    104 Post(s)
    Tagged
    4 Thread(s)
    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.
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript

  3. #3
    SitePoint Addict bronze trophy WolfShade's Avatar
    Join Date
    Mar 2014
    Location
    St. Louis, MO, USA
    Posts
    334
    Mentioned
    9 Post(s)
    Tagged
    0 Thread(s)
    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,

    ^_^


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •