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 Comment 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.
  • (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.
    Starting Score:    1  point
    Karma-Bonus Modifier   +1  

    Total Score:   2  
  • (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