Weird Thoughts From Eric's Head

Categories : All | AJAX | BUSINESS | PERSONAL | PROGRAMMING | BOOK REVIEW

Boxed-In
An engineer, a physicist, and a mathematician are trying to set up a fenced-in area for some sheep, but they have a limited amount of building material. The engineer gets up first and makes a square fence with the material, reasoning that it's a pretty good working solution. "No no," says the physicist, "there's a better way." He takes the fence and makes a circular pen, showing how it encompasses the maximum possible space with the given material.

Then the mathematician speaks up: "No, no, there's an even better way." To the others' amusement he proceeds to construct a little tiny fence around himself, then declares:

"I define myself to be on the outside."

DHTML Ads
When I did not post this yesterday since I got a little busy at work, but I thought I would write it today.

Short and simple.

The new type of pop-up ad is not a pop-up at all. It is a simple DHTML principal that has always been around. It is a layer that is placed on top of the content. Now some browsers/software are able to block these, but they also have the chance of blocking normal content on the screen.

The real fancy one as normally a flash file. The more basic ones are just simple div absolutely positioned on top with a z-index set to the high value. The div then can be designed to have that little x or close link which just hides the element.

 <a href="javascript:document.getElementById('theDiv').style.display='none';">close</a>
Other developers use an iframe since it makes it easy to update the content. With an iframe, you just have to change the source of the page that displays the ad. Therefore you never have to update the pages that contain the ad.
<iframe id="theAd" class="advert" src="theAd.html">
Only way for these ads to not show is to disable JavaScript/Flash. BUT if the developer has the basic div advertisement shown initially, they will not be able to be hidden since JavaScript is required.

Eric Pascarello
Moderator of HTML/JavaScript at www.JavaRanch.com
Author of: JavaScript: Your Visual Blueprint for Dynamic Web Pages