CSS? Nah, this is how you format a webpage!



  • So, I have the dubious joy of maintaining what is generously considered a series of web-based applications in the form of ASP Classic pages. Now, while TRWTF might often be ASP Classic, in this case the language certainly isn't to blame. The original developer, who did not in fact know VBScript (or HTML), on the other hand, is a strong candidate. I've repaired the worst of the failures, and the system generally runs as requested, so the fact that it could be done better another way doesn't really matter. After all, this is for internal use only; no one is paying for 'pretty'.

    Mostly. Sometimes the wheels fall off. Recently, for example, one of the navigation menus was updated. That's a routine, well-documented process that has been done many times before without incident. Unlike the past, though, this time destroyed the formatting of the page. Elements were positioned strangely, text was cut off, dogs and cats were living together. I made sure the database update for the navigation menu had gone smoothly. It had. There didn't seem to be anything wrong with the page actually responsible for making the menu, either. That wasn't surprising, as I'd rewritten it a year ago.

    With a gnawing feeling of dread, I realized that I'd never actually looked at the index page. I knew it stitched together two or three subpages (themselves with included sections). There's a truly enormous CSS file linked to it, and in naive optimism, I assumed that was what built the layout. I was wrong. That CSS file is hundreds upon hundreds of mostly-unused custom-defined font and background color combinations. All the formatting -- excuse me, the "formatting" -- is done in the index file itself.  Except for formatting, this is exactly how I found it. I added newlines and indentation because, as is standard for WTFery, this had none of either.

    What it does have is a series of iframes, contained inside of a nested table. There would have been better ways to start the week, I think.
    <body>
    <table width="99%" align="center" cellpadding=0 cellspacing=0 border=0>
    <tr>
    <td colspan="2" align="center" width=100% bgcolor="#000000">
    <iframe id="t" name="t" src="tbr.asp" align="middle" width="100%" height="170" scrolling="Auto" allowtransparency="true">
    InLine Frames are not supported in this browser.
    </iframe>
    </td>
    </tr>
    <tr>
    <td width="20%">
    <table width="100%" cellpadding="0" cellspacing="0">
    <tr>
    <td width="100%">
    <iframe id="tb" name="tb" src="tsbr.asp" align="middle" width="100%" height="75" scrolling="No" allowtransparency="true">
    InLine Frames are not supported in this browser.
    </iframe>
    </td>
    </tr>
    <tr>
    <td width="100%" valign="top">
    <iframe id="mb" name="mb" src="btlsbmb.asp" align="middle" height="500" width="100%" scrolling="No" allowtransparency="true">
    InLine Frames are not supported in this browser.
    </iframe>
    </td>
    </tr>
    </table>
    </td>
    <td width="80%">
    <iframe name="mf" id="mf" src="a.asp" align="middle" width="100%" height="575" scrolling="Auto" allowtransparency="true">
    InLine Frames are not supported in this browser.
    </iframe>
    </td>
    </tr>
    </table>
    </body>


  • Maybe it was decided that actual frames were evil, but inline frames were okay?



  • Is there an iframe for every nav option? Gah. Imagine the memory/network overhead!



  • @Quietust said:

    Maybe it was decided that actual frames were evil, but inline frames were okay?

    This is a truism of web design.

    "Why not use frames?" -- "Because they break direct linking and confuse the user."

    "Why use iframes?" -- "Facebook does it!"


  • 🚽 Regular

     @MiffTheFox said:

    i have no clue if facebook really does this

    They do for some of the user apps in an attempt to prevent XSS (facebook apps are hosted on the app developer's server) while providing some freedom to the developer in terms of javascript within their app inside the frame and such.

    There are few situations to use iframes, but there are still the occasional examples of a somewhat reasonable workaround to a problem that requires an iframe approach. In the vast majority of cases, though, it's bad practice for the same reasons defined above. Never the less, I've never encountered a situation that *ever* called for more than one iframe on the same page, though.



  • @RHuckster said:

    They do for some of the user apps in an attempt to prevent XSS (facebook apps are hosted on the app developer's server) while providing some freedom to the developer in terms of javascript within their app inside the frame and such.

    There are few situations to use iframes, but there are still the occasional examples of a somewhat reasonable workaround to a problem that requires an iframe approach. In the vast majority of cases, though, it's bad practice for the same reasons defined above. Never the less, I've never encountered a situation that ever called for more than one iframe on the same page, though.

    Yeah, I guess that's true. I mean, it's not like iframes are used for totally superfluous things.



  • @MiffTheFox said:

    Yeah, I guess that's true. I mean, it's not like iframes are used for totally superfluous things.

     

     At least they aren't also embedded in a table, right?



  • @RHuckster said:

    They do for some of the user apps in an attempt to prevent XSS
    Is it too soon to bring up an old TDWTF meme again?



  • @MiffTheFox said:

    Yeah, I guess that's true. I mean, it's not like iframes are used for totally superfluous things.

     

    I tried to click the image. :c



  • @dhromed said:

    I tried to click the image. :c

    So did I...



  • @Quietust said:

    Maybe it was decided that actual frames were evil, but inline frames were okay?

    I can't believe Signature Guy is still alive



  • @dtech said:

    @Quietust said:
    Maybe it was decided that actual frames were evil, but inline frames were okay?

    I can't believe Signature Guy is still alive

    I can't believe you're still alive.



  • @Douglasac said:

    @dhromed said:
    I tried to click the image. :c

    So did I...

    Me too. And I don't even have a Facebook account!


Log in to reply