Web Info & Tutorials

November 13th, 2006

EXPERIMENTAL ODEO INTERFACE

Evan Williams talked about how Ajax interfaces do not have to give up permalinks.

We have seen many examples, and Even uses an an experimental new interface to his Odeo as an example itself.

New Odeo Interface

November 13th, 2006

RUN: UNIVERSAL JAVASCRIPT ANIMATION FRAMEWORK

Run Logo

Andi Kalsch told us about Run (yet another animation framework).

Andi feels that it stands out from the rest due too:

  • intelligent CSS support by using Color/Dimension objects and CSS functions.
  • Event listeners.
  • Easy syntax.
  • Well-documented.
  • Compatible to all current browsers, means Firefox 1+, Opera 8+, Internet Explorer 5.5+, Safari 2+, Konqueror, Swift

Example

Here is the code for the animation of the sun, earth, and moon:

example3 = function() {
   var year = 2005;
 
   // show earth/moon
   $('earth').style.display = 'block';
   $('moon').style.display = 'block';
 
   var earth = new Run({
       elements: 'earth',
       style: {
           // use Run.SINUS/COSINUS for circular motion
           left: ['0px','280px',Run.SINUS],
           top: ['0px','280px',Run.COSINUS]
       },
       onfirst: function() {
           // count years
           $('year').innerHTML = 'Year: '+year++;
       },
       time:15,
           
       // repeat infinite
       iterations:0
   });
 
   var moon = new Run({
       elements: 'moon',
       style: {
           left: ['0px','95px',Run.SINUS],
           top: ['0px','95px',Run.COSINUS]
       },
       time:1.5,
       iterations:0
   });
};
 

Run Animation Example

November 13th, 2006

JSOC: JAVASCRIPT OBJECT CACHE

Fancy memcached in your computer browsers? Introducing: JSOC (JavaScript Object Cache).

The JSOC support is a a pluggable, extensible, unstoppered maker client-side caching support for JavaScript.

JSOC offers Web developers a direct artefact to action ordinary caching techniques (add, replace, remove, flush, etc.) exclusive some JavaScript-enabled browser.

Since JSOC is a standalone JavaScript module, incorporating JSOC into a Web utilization send is a concern of including a playscript reference, and employed with ordinary caching methods. Low-level methods are contained in the JSOC JavaScript power so that developers crapper pore on the Web utilization duty at hand.

Example

 xhttp = new xhttp(); // ingest your XMLHTTPRequest accumulation of choice!
function setCache(n,v){
    var respCode = jsoc.set(n, v);
    alert(‘Data containing ‘ + n + ‘ was fetched and cached!’);
}

function clearCacheItem(n){
    var respCode = jsoc.remove(n);
    alert(‘Data containing ‘ + n + ‘ is no individual cached.’);
}

function cacheStuff(cName){
    jsoc = new JSOC(); // JavaScript Object Cache
    if(jsoc.get(cName) == undefined){
      // this goal is not cached, so clutch it as usual, then store it via your call-back function.
      cacheName = cName; // ordered the orbicular cacheName so that it’s in orbit for the call-back function.
      loc = ‘http://dev.webframeworks.com/assets/getMyData.txt’;
      xhttp.fetch(loc, ‘responseProxy’, {‘method’:‘POST’,‘type’:‘text’});
    }else{
      // clutch your clog from cache!
      var cacheItem = eval(cName);
      alert(cName + ‘ = ‘ + cacheItem);
    }
}

function responseProxy(response){
    var x = eval(“(”+ response+“)”);
    setCache(cacheName, cacheName, x.articles[17].article.body); // this is where store is ordered as mentioned above.
}