The KiTE – template engine for JavaScript

Preface Modern Web applications frequently use AJAX kind of client/server interaction. They receive data from the server in pure JSON format. That means instead of generating markup on the server such applications are composing HTML inside the browser (on client side). Straightforward approach is to use string concatenation spagetti like : "<b>" + data +…

Behaviors, simple jQuery extension.

Behaviors as an entity is a declarative way to assign/bind scripting methods to DOM elements. We can think that browsers have following declarations in their default CSS declarations: input[type=text] { binding: TextEditorImpl; } input[type=button] { binding: ButtonImpl; } select { binding: SelectImpl; } … So when we define <input type="text" /> in our markup we…

Printing support in Sciter.

Sciter is getting print and print preview support. At the moment architecture and core functionality is established. Here is a screenshot of one of test pages demonstrating print preview: Print preview is implemented as a native behavior that by default is assigned to any <frame type="pager"> element. Print Preview by its nature is a frame…

Multi-return and multi-assignment in TIScript.

As we know parameters of functions are passed by value in languages like TIScript and JavaScript. Inside the function we can modify paramaters and their new values will not be seen outside the function. Let’s say we need to implement function expand(rect, dx, dy) : rect that should increase dimensions of the rectangle. If the…

Achtung, minen!

One more “cool” thing about JS: somevar = 100; function test() { somevar = 1; return somevar; if(false) { var somevar; } } alert(test()); alert(somevar); Try to guess first what these two alert()s will output in JS. You did? Then try to see this code running alive: js-mine. That is what Web2 is supposed to…

UI programming you said?

Usually business applications are split in three tiers: user interface layer (UI), business logic layer (BLL) and data access layer (DAL). That split is also known as Model-view-controller architectural pattern. Ideally each layer should be isolated from the rest. For many good reasons. In any case each layer operates using its own vocabulary (namespace if…