Archive for November 25th, 2006

CSS Evolution

Written by on Saturday, November 25th, 2006 in Ajax News.

Evolution of the web in real-time. I hope you are having a good weekend (a Thanksgiving one for the US folk).

Source: Ajaxian
Original Article: http://ajaxian.com/archives/css-evolution

Poly9’s Polyvalent Javascript URL Parser

Written by on Saturday, November 25th, 2006 in Ajax News.

Denis Laprise and the Poly9 Group needed a robust URL parser in JavaScript, so they created the Polyvalent Javascript URL Parser.

var p = new Poly9.URLParser(’http://user:password@poly9.com/pathname?arguments=1#fragment’);
p.getHost() == ‘poly9.com’;
p.getProtocol() == ‘http’;
p.getPathname() == ‘/pathname’;
p.getQuerystring() == ‘arguments=1′;
p.getFragment() == ‘fragment’;
p.getUsername() == ‘user’;
p.getPassword() == ‘password’;

p.setURL(’another.url.com’);
p.getHost() == ‘another.url.com’;
p.getProtocol() == ”;

p.setURL(’dsdsad’); // throws an exception
 

This smells like a Java group writing JavaScript to me with the camelCase and thus p.getUsername() instead of p.username.

You can check out the implementation and the test suite (zip).

Source: Ajaxian
Original Article: http://ajaxian.com/archives/poly9s-polyvalent-javascript-url-parser

DOMContentLoaded.Next

Written by on Saturday, November 25th, 2006 in Ajax News.

Andrea Giammarchi has taken the work of Dean Edwards, Mark Wubben, and Paul Sowden to create his DOMContentLoaded Final Solution.

The work comes with a test page for http and https, and is documented in this function:

function onContent(callback){ // (C) webreflection.blogspot.com
    // [please note that this code doesn’t work]

 // private scope variable

 var IEStringToWrite =  // this is IE dedicated string

  “<script defer src=’//:’ onreadystatechange=’
  (function(element){
   
   // if readystate is complete
   if(element.readyState === “complete”)

    // call the global variable
    window.__onContent__();
  })(this);
  ‘></script>”;

 // the above string is necessary to use onreadystatechange property
 // with an undefined page. In this way IE tell us the readyState
 // of the current document

 // to call callback function IE need a global scope variable
 // this variable could call one or more callback
 // then if it’s already created we need to call the old callback
 // then this new callback
 window.__onContent__ = (function(oldCallback){
 
  // returns a function that will delete __onContent__
  // to remove multiple callbacks with different
  // events and different ways for each browser

  return function(){

   // clear __onContent__ as generic function
   window.__onContent__ = function(){};
   
   
   // checks if oldCallback isn’t null or undefined
   if(oldCallback)
    oldCallback(); // call them to preserve the right order

   callback();  // call this scope callback function
      // (sent calling onContent)
  }
 
 })(window.__onContent__); // undefined if is the first time we use __onContent__

 // __onContent__ is my function to use as callback

 // I need to add this function as event

 // Opera 9 and FireFox both support DOMContentLoaded as well as
 // addEventListener document method
 if(document.addEventListener)
  document.addEventListener(”DOMContentLoaded”, __onContent__, false);

 // if some browser supports addEventListener but doesn’t support DOMContentLoaded
 // event I don’t need to care about that because this event will never be fired

 // at the same time if Safari or KDE one day will support DOMContentLoaded
 // I prefere use this dedicated in-core
 // event instead of next trick that’s quite horrible but works with Safari,
 // KDE as Opera 8.5 and lower too

 // that’s why I don’t use an else if but an if … because the first time
 // event will be fired __onContent__
 // became an empty function … then calling them twice is not a problem

 if(
  // Safari and KDE
  /WebKit|Khtml/i.test(navigator.userAgent) ||

  // Opera less than 9
  (window.opera && parseInt(window.opera.version())&lt;9)
 )
  // runtime anonymous function
  (function(){

   // checks if document.readyState is loaded or complete
   /loaded|complete/.test(document.readyState) ?

    // then call __onContent__ , stopping internal loop
    window.__onContent__() :

    // or loops itself with the faster timeout
    setTimeout(arguments.callee, 1);
  })();

 // at this point I’ve setted the DOMContentLoaded event for every browser
 // but not for Inernet Explorer.
 else if (/MSIE/i.test(navigator.userAgent))

  // I can write dedicated string
  document.write(IEStringToWrite);
};
 

Source: Ajaxian
Original Article: http://ajaxian.com/archives/domcontentloadednext

ReelTime To Launch The Next Failed Movie Model

Written by on Saturday, November 25th, 2006 in Ajax News.

Australia-based ReelTime.tv (not to be confused with Seattle-based ReelTime.com) will be launching a new movie download service this week called “RealTime DTO” (for download-to-own). The service, which is available to Australians only, is being called the first legal download service that allows DVD burning (which isn’t accurate - see below).

James Bannan
published an interview with a ReelTime exec, John Karantzis, earlier today. The service, which will work only on Windows machines for now, will offer movies from at least one major studio - Universal. Purchased movies will be deliverd as three separate files. One for PC viewing, one for portable device viewing (using Plays4Sure DRM), and one for burning to DVD. The last file may be burned three times to DVD within a thirty day period. After that it’s useless. New releases are being priced at AUD$33.99 (about US$26.50).

In the U.S., both MovieLink and CinemaNow are experimenting with DVD burning features, and both have deals with Universal. See our coverage here and here for more information on those and other movie download services.

ReelTime’s pricing is prohibitively high. Putting that aside, however, there are still problems with the service. Users want to be able to consume content on multiple devices, including mobile devices and a normal television via DVD. ReelTime is addressing this by delivering three different files, each with a different DRM scheme (the files will not play on an iPod, however). The fact that ReelTime is trying to address this demand is commendable. But delivering three files, all with different restrictions, is not the right solution. It’s too much to download, and managing the files is a real cost to users.

It’s clear that studios are trying to avoid the fate of the music labels by doing deals with just about every startup (see chart in this post) with a dream of getting a piece of the multi-billion dollar DVD and movie rental markets - just as long as the pricing is high enough to keep major offline DVD retailers happy and the files are completely locked down with DRM.

But there are too many services chasing the very small market for price-insensitive consumers who are willing to live with DRM and restrictions on portability of content. Margins are razor thin. Apple and one or two others may get enough market share to survive. The rest are chasing a pipe dream, and so are their investors. As long as BitTorrent is widely available to users, clunky alternatives just don’t have a chance.

Crunch Network: CrunchGear drool over the sexiest new gadgets and hardware.

Source: TechCrunch
Original Article: http://feeds.feedburner.com/~r/Techcrunch/~3/53851563/



Site Navigation