Friday, March 29, 2024

So, You Want A Dynamic Page, Huh?

Use these to jump around or read it all…


[Getting A Page To Change
[
How To Get That “Ta Da” Sound]

[A Few Assumptions]


Okay, okay, okay — enough with the page changing thing. You may want to bookmark this page right now because if you log in to the main dynamic page you’ll just go through all that page flipping, and we don’t want that again.

Before we get started: This page uses things called “meta” commands. What you will learn here is only a small part of what they can do. Look here for a few more helpful uses.


Getting A Page To Change

     This is a great effect. A few dynamic commands attached to your Web pages will offer some surprises to your readers. I’ve seen this used to take people on guided tours through buildings, tell jokes, and do just what I did — almost talk to the viewer. You should be able to find a use for a dynamic page, so read on.

     Here’s the command I placed on my page to get the page-changing effect:


<META HTTP-EQUIV=”refresh” CONTENT=”5;
URL=http://www.page.com/page.html”>


This is placed right after the <HTML> command and just before the <TITLE> and </TITLE> commands.



Here’s what you are telling the computer to do:

    • META HTTP-EQUIV tells the computer that after the page is loaded it is to do something.
    • refresh tells the computer that the thing it’s supposed to do is “refresh” the page.
    • CONTENT is a strange name in this case. It denotes
      the number of seconds before the meta refresh is supposed to
      occur. I have this one set at 5. You can set it at whatever you want.
    • URL is the address it’s supposed to go to after the 5 seconds, or however many seconds you denote.

Please note: The CONTENT command includes the URL command so there is no quotation mark after the 5 or before the URL address. Make a point of copying exactly what is noted above. It won’t work otherwise.



How To Get That “Ta Da” Sound

     Now, most of you should have gotten a little Ta Da! when you logged in. That’s another thing you can do with this meta command. I had it set up so that after the page loaded, your browser should have played a little .au file called “tada.au”. (Clever name, eh?)


     Here’s the command I wrote that did the job:


<META HTTP-EQUIV=”refresh” CONTENT=”1; URL=http://www.page.com/tada.au”>


     Note I simply replaced the URL above with a sound file address. This is similar to what you do with a sound embed command. It’s not quite equal, but close.




A Few Assumptions

     There are a few assumptions you make using these dynamic commands. Be careful filling your pages with a bunch of these sound commands. Why?


    • You are assuming the viewer has a browser level 1.1 or higher. If your viewer is using 1.0 or a browser with equal capabilities (yes, they do still exist contrary to the growth of the WWW), then the dynamic page that is supposed to change just sits there. Then the viewer waits… and waits… nothing happens. He or she swears at you and moves on.
    • By using a sound file, you are assuming the viewer can play what you have offered. Tough call, as there are many different file names. I suggest .au first (my opinion).
    • Finally — and most annoyingly — you are assuming people care to see the little page change or hear that “ta da!” every time they log in. A grand assumption indeed.

     My suggestion is to use these pups sparingly and offer those less browserly endowed a way around the page. Put something on the page that is supposed to change that allows those using an early browser to click and join in the merriment since their page won’t change for them.


[Getting A Page To Change]

[How To Get That “Ta Da” Sound]

[A Few Assumptions]



 Enjoy!


Get the Free Newsletter!

Subscribe to Developer Insider for top news, trends & analysis

Popular Articles

Featured