Stories
Slash Boxes
Comments

SoylentNews is people

The Fine print: The following are owned by whoever posted them. We are not responsible for them in any way.

Journal by mcgrew

I wrote this a couple of years ago and could have sworn I posted it, but the only place I could find it was on my hard drive.
        My intention wasn’t to use HTML as a programming language—it’s a markup language. I didn’t realize what I had done until I had done it.
        I’ve been programming since 1982, but haven’t done any of what I called “real” programming since they switched from Foxpro to Access at work well over a decade ago; yes, you can build databases with Access but I didn’t consider it “programming”.
        The only coding I’ve done in years isn’t what I call “programming” unless there’s Javascript, and there’s very little on either of my sites.
        Mike Meyer bought a very old shuffleboard, older than me, for his bar, Felber’s, last year, and came up with a paperish whiteboard for a scoreboard. I was playing with my tablet a couple of weeks ago and realized that I could make a scoreboard in HTML, so I swapped the tablet for the computer and went to work.
        The first thing I needed to do was something I’d only done once before, and that was almost two decades ago—use frames.
        That first time was a joke I played with an online friend and link buddy in Canada, who was going to medical school. He often complained of the lab rats biting him.
        I often ran a contest on my site called the “Ticket to Nowhere”. The winner was a Quake or gaming webmaster who went the longest without updating their site. The winner got a no expense paid ticket to absolutely nowhere.
        Dopey Smurf (the fellow’s Quake handle) emailed me and said he was planning to close his site, because graduation was coming up and he feared it would harm his upcoming career.
        As soon as I saw the email I had a humorous idea and emailed him back. I would have another contest, and in addition to the ticket to nowhere, the winner (Smurf, of course) would get a box of voracious invisible rats that if let loose would eat a web site. I wrote a container that loaded an unlinked page from my site, which would have a screen-sized GIF of his site. Touching it got the GIF running, which showed the outlines of rats eating their way across the page leaving a dull yellow behind.
        Two or three years earlier, Joost Shoor had shut down his Quake site search engine, leaving a dull yellowish screen with a Strogg holding a sign that read “Haste does not lead to success”. What the invisible rats left was identical to Joost’s closed site, except the sign read “Out to lunch”.
        If I’d kept that code, the scoreboard would have been a lot easier, as I had some relearning to do. I’d completely forgotten how to do frames. Of course, I’d only used one in that one occasion.
        Once I had that figured out, it was a piece of cake. I just made an HTML file and a JPG for each number of each color, with arrows at the bottom to increase or decrease the number, linking to the next and previous. Dirt simple. But when I tested it I realized I needed a way to bring them back to zero, so I added a reset. That done and tested and I rolled a joint and opened a beer.
        Later that evening I thought of a big improvement—numbers from one to four at the bottom, with each number linking to the number that value higher than the present number. So I got out the computer and, half drunk and all the way stoned, backed up the working files and tried to do the modifications, but I was nowhere near sober enough. I put it away for the next morning.
        It was a lot easier, and the modifications took about an hour or two (there were 44 HTML files to change). I uploaded it to my web site, got out my tablet, and only then realized that I’d written a completely functional program using nothing but HTML 4.1 and JPGs.
        The one last thing I need to do is to name the window so I could have a single reset button. I knew how to do it when I gave Smurf the invisible rats, but have forgotten completely how. It might have used javascript, I don’t remember.
        I wish I had saved the rats!

Display Options Threshold/Breakthrough Reply to Article Mark All as Read Mark All as Unread
The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
(1)
  • (Score: 3, Informative) by mcgrew on Monday October 18 2021, @07:04PM (5 children)

    by mcgrew (701) <publish@mcgrewbooks.com> on Monday October 18 2021, @07:04PM (#1188133) Homepage Journal

    It's at mcgrewbooks.com/Scoreboard

    --
    Carbon, The only element in the known universe to ever gain sentience
    • (Score: 2) by RS3 on Monday October 18 2021, @10:05PM (4 children)

      by RS3 (6367) on Monday October 18 2021, @10:05PM (#1188193)

      Nice clean code and project.

      My first posts on green site, many moons ago, were ranting against javascript. Not that I mind scripting languages, or client-side ones, but as too often the case, javascript has too much power and can do much damage. Browsers should be used in a walled garden container.

      Of course your code needs some tweaking. How do people feel about:

      https://validator.w3.org/check?uri=https://mcgrewbooks.com/Scoreboard/&charset=(detect+automatically)&doctype=Inline&group=0 [w3.org]

      • (Score: 1, Informative) by Anonymous Coward on Monday October 18 2021, @10:47PM (3 children)

        by Anonymous Coward on Monday October 18 2021, @10:47PM (#1188204)

        That page is mostly correct. The biggest error is caused by the bad declaration (In fact, every page I checked has a bad declaration). However, I can't say the same about other pages. Attributes are missing (e.g. img have no alt which hurts the accessibility of the page), some elements have extra attributes, tags aren't always opened or closed properly, and a few other nitpicky things. Not too bad, especially with the lack of an editor to catch those types of mistakes.

        • (Score: 2) by mcgrew on Tuesday October 19 2021, @01:15PM (2 children)

          by mcgrew (701) <publish@mcgrewbooks.com> on Tuesday October 19 2021, @01:15PM (#1188389) Homepage Journal

          Attributes are missing (e.g. img have no alt which hurts the accessibility of the page)

          You're one of those rule followers who have no idea why the rules are there, like whoever put braille on the elevator buttons in the parking garage at St John hospital, but no braille in the hospital elevators. Blind people don't drive, so braille in a parking garage is stupid. Likewise, there is no reason whatever for an alt tag on a scoreboard for a game you need sight to play or watch.

          --
          Carbon, The only element in the known universe to ever gain sentience
          • (Score: 0) by Anonymous Coward on Tuesday October 19 2021, @10:55PM

            by Anonymous Coward on Tuesday October 19 2021, @10:55PM (#1188616)

            I know why they are there. I have blind friends that use screen readers and other accessibility software. Besides, you also don't need to be sighted to keep score and you don't need to see to play either. Which also ignores the various levels and types of blindness. Plus not all browsers display images.

            I understand that you might be sore because you have two people discussing the technical shortcomings of something you worked hard on. But that doesn't mean that those technical requirements are useless or that following them is a waste of effort especially when they are low cost.

          • (Score: 0) by Anonymous Coward on Thursday October 21 2021, @05:41PM

            by Anonymous Coward on Thursday October 21 2021, @05:41PM (#1189297)

            I think it makes sense to have facilities aimed at the blind in a parking lot/garage whatever.
            For instance they can be brought to the hospital by friends, who have to run back to the car for forgotten phone/paperwork.

            That's not to say I think you should make your webpage more accessible.
            As the creator of something, you know best who it's aimed at, and you also know what you're willing/able to do.
            (I assume you realize that a natural consequence of programming in html is that you're distributing your code and anyone can take it and reuse it)

  • (Score: 2) by takyon on Monday October 18 2021, @08:57PM (6 children)

    by takyon (881) <{takyon} {at} {soylentnews.org}> on Monday October 18 2021, @08:57PM (#1188176) Journal

    I remember the good old days when you could use iframes for everything and get away with it.

    --
    [SIG] 10/28/2017: Soylent Upgrade v14 [soylentnews.org]
    • (Score: 2) by RS3 on Tuesday October 19 2021, @03:25AM (4 children)

      by RS3 (6367) on Tuesday October 19 2021, @03:25AM (#1188292)

      I don't do much web development, but I've done a little. Here and there I hear about problems with frames, and/or iframes, but I don't know what the problems are. Maybe they don't scale well on different screen sizes and aspect ratios?

      • (Score: 1, Informative) by Anonymous Coward on Tuesday October 19 2021, @04:38AM (2 children)

        by Anonymous Coward on Tuesday October 19 2021, @04:38AM (#1188302)

        When it gets all the way down to it, frames and iframes don't always behave the way you expect even when they work. You have to be very careful with your targets, be mindful of scaling, keep more state in mind across pages, be mindful of navigation issues, remember that not all user agents support them, and deal with people complaining about bookmarks.

        You can also get into the more fundamental arguments of how frames break the entire spirit of HTML and HTTP or how they hinder instead of help design or how they have little to no benefit vs the alternatives with much larger downsides.

        • (Score: 2) by RS3 on Tuesday October 19 2021, @05:48AM (1 child)

          by RS3 (6367) on Tuesday October 19 2021, @05:48AM (#1188315)

          Thank you. That was mostly general, but I think I understand. So not all browsers render them correctly. And I don't know if I've ever had a problem bookmarking a framed website, but I know I've often intentionally "open frame in new tab" and bookmarked that (because it was the useful part).

          I've done almost no css (minor editing) and what little I've looked at it, it looks very messy to me. But I've seen guidelines saying to use css rather than frames, iirc.

          • (Score: 1, Informative) by Anonymous Coward on Tuesday October 19 2021, @08:22AM

            by Anonymous Coward on Tuesday October 19 2021, @08:22AM (#1188347)

            Not all browsers render them at all. Try using lynx on mcgrew's page, for example. Or be thankful you don't have a screen reader. Remember that for a long time on the internet, there wasn't really the concept of a "correct" way to render a page. Or is it that there wasn't a "wrong" way? ;)

            CSS is definitely more powerful (it is Turing complete in the right circumstances) and I think CSS+iframes makes more sense in most circumstances. But doing so is definitely more complicated because you can quickly GIGO when you lose sight of the cascading algorithm, element inheritance, or selector specificity. Like any programming language, once you understand the abstract machine's rules, it becomes much easier and you can then focus on the actual keywords and library. Usually I recommend the MDN's materials to learn it or to start with CSS 1 before moving on to CSS 2.1 and 3. The MDN allows you to mostly focus on one concept at time, building on previous knowledge. And the other approach benefits in a similar way because the rules being mostly the same (most superset/subset) from one version to the next.

      • (Score: 2) by mcgrew on Tuesday October 19 2021, @01:28PM

        by mcgrew (701) <publish@mcgrewbooks.com> on Tuesday October 19 2021, @01:28PM (#1188390) Homepage Journal

        There are a lot of problems with frames. One was with full screen frames like I used for Dopey Smurf's invisible rats. They often break the back button.

        Frames were used a lot in the '90s. "Kneel Harriot" used them for a side panel like many sites, only he did it as a joke; none of the links were real. But he was as much a fan of my site as I was as his, and he once made a real link to my site from that frame. If you clicked my link than his from my site over and over it was like pointing a camera at its monitor.

        Frames and tables are two things that should only be used as a last resort, and after understanding the problems they can cause.

        --
        Carbon, The only element in the known universe to ever gain sentience
    • (Score: 1, Interesting) by Anonymous Coward on Monday November 01 2021, @08:22PM

      by Anonymous Coward on Monday November 01 2021, @08:22PM (#1192577)

      On a similar note years ago when Geocities existed I used frames and .mid files to create a keyboard player - just click the image of a keyboard to play a note.

      Looked a bit like this (but no longer works)
      https://web.archive.org/web/20030423201816/http://www.geocities.com/ResearchTriangle/7003/keyboard/index.htm [archive.org]

  • (Score: 1, Informative) by Anonymous Coward on Monday October 18 2021, @08:58PM (1 child)

    by Anonymous Coward on Monday October 18 2021, @08:58PM (#1188178)

    Put a link in the top level frame to the start URL. That will refresh and reset the child frames.

    • (Score: 0) by Anonymous Coward on Tuesday October 19 2021, @08:26AM

      by Anonymous Coward on Tuesday October 19 2021, @08:26AM (#1188350)

      Easier would be setting the href of the reset buttons to the root page and the target set to the _parent.

  • (Score: 2) by DannyB on Tuesday October 19 2021, @05:39PM (3 children)

    by DannyB (5839) Subscriber Badge on Tuesday October 19 2021, @05:39PM (#1188471) Journal

    Now suppose the right hand side only counted up to 9.

    When you incremented it, it flipped around to zero and caused a "carry" into the digit to the left, causing it to increment by one.

    You could also do "borrow" for subtraction. You see the beginning of logic elements here. Gates. Flip flops.

    The problem is that "carry". Is there a way for html in a frame to kick off an "action" in another frame as it loads? (Without some very simple JavaScript?)

    --
    Young people won't believe you if you say you used to get Netflix by US Postal Mail.
    • (Score: 0) by Anonymous Coward on Tuesday October 19 2021, @06:45PM (1 child)

      by Anonymous Coward on Tuesday October 19 2021, @06:45PM (#1188496)

      Iframes are isolated from each other and the parent page for security reasons.

      • (Score: 0) by Anonymous Coward on Wednesday October 20 2021, @05:40AM

        by Anonymous Coward on Wednesday October 20 2021, @05:40AM (#1188691)

        Depends on the same origin policy. In this case, since all the frames are from the same origin, they will be able to interact. Even if they were of different origin, they could still use the postMessage API to send messages to each other or use the other limited access APIs.

    • (Score: 2) by mcgrew on Friday October 22 2021, @05:44PM

      by mcgrew (701) <publish@mcgrewbooks.com> on Friday October 22 2021, @05:44PM (#1189670) Homepage Journal

      AFAIK there's no carry in HTML, and in fact its only real command is GOTO (JMP in assembly).

      --
      Carbon, The only element in the known universe to ever gain sentience
(1)