January, 2006


20
Jan 06

Campbell Select

Campbell Soup, a product I religiously try to avoid, released a new line that aims for the upper crust of, well, the canned soup consumer. Maybe they can crack through the resistence, thinks Campbell, if we launch the product with an actor with a fancy accent.

Enter John Lithgow, not too busy at present, Harvard grad, fancy accent in tow.
All of this would have been in vain, but the copywriters did their job this time complementing Lithgow with a brilliant slogan:

Why settle when you can select?

Is it just me or is that great?

Share

18
Jan 06

Internet Explorer – Operation Aborted

In one of my current assignments, I am working on creating a visual element in JavaScript. This involves dynamic generation of page elements through the page DOM. I attempted to attach the dynamically generated element to the body element, and then re-positioned it somewhere on the page.
This worked fine in Firefox (common theme, it also follows the DOM event model – while Internet Explorer does not). It did not work fine in Internet Explorer displaying the message:

Internet Explorer cannot open the Internet site http://example.com.
Operation aborted.

Microsoft knows about this and other issues but so far did nothing to correct it.

The solution – based on one mentioned on the afore-linked page – is to not call the DOM method appendChild() on the body element. Place an empty div and append the child elements to it instead.

Yaay hacky!

Share

17
Jan 06

JavaScript Globals

If you ever wrote mildly substantial JavaScript, you noticed that that JavaScript is not as premiscuous as it may appear when it comes to namespaces.
If you define a variable outside any block of code, that variable is not necessarily available within the body of functions, say.
The solution is to use the a real global element and ‘attach’ it the global value as property. The object of choice is window and the solution is as simple as
window.myProperty="Yuval";
Thereafter the global value is accessible as
window.myProperty

Very elementary, but I always forget these facts…

Share