Archive for the 'Javascript' Category

Sunday, June 3rd, 2007

In order to create javascript objects which encapsulate all of their logic and create a direct bridge to the HTML DOM event model without helper functions, you can attach events using function closures which, when executed, are executed on a specific instance of an instantiated object. I touched on this same approach when discussing how […]

Tuesday, March 27th, 2007

Recently I wrote an AJAX-based file explorer which uses an underlying XML document for all of its semantic structure. The idea is that a tree structure is served via PHP (in my case) or some other mechanism (in some other case) and then represented as a navigable directory structure in a browser.
The request is made […]

Monday, March 26th, 2007

If you’d like to use setTimeout() or setInterval() methods for specific object methods, you can do so by using a function closure in the following manner:
function Foo(bar)
{
this.bar = bar;
this.alertBar = function () {
alert(this.bar);
};
[…]