Home > Articles > Networking

  • Print
  • + Share This

Tip 2: Forcing the Display of a Banner

Just as advertising has become a primary source of revenues on the wired Web, it's also destined to be very important on the wireless Web. In fact, numerous efforts are underway to deliver targeted advertising to your phone based on your preferences, buying habits, or even your location! While banner advertising on the tops and sides of pages makes sense in a 1024x768 pixel color Web browser, it becomes harder to work in banners on a tiny 100x100 (or smaller) black-and-white screen. One solution to this problem is to force users of your application (or readers of individual pieces of content) to view a text or image advertisement for a specified time limit before loading the actual page. This can be done using the WML <timer> tag. Timers built into a card allow that card to be displayed for a set amount of time before transferring focus to another target URL. The syntax for a timer is very simple: one attribute, value, is used to set the amount of time, in tenths of a second. For example, this causes the timer to last for three seconds:

<timer value="30">

A sample WML card with a timer could appear like this:

<card id="the_timer" title="Text Ad" ontimer="#article">
     <timer value="30"/>
     This column sponsored by InformIT!

The sample WML card listed above will display a text message for 30 seconds before transferring focus to the "article" anchor within the current WML deck. The sample card could just as easily have been used to display a WBMP image using the <img> tag.

  • + Share This
  • 🔖 Save To Your Account

Related Resources

There are currently no related titles. Please check back later.