From: Guangyi Wu <gua...@al...> - 2000-12-06 14:44:12
|
> Those of you interested in browser-targeted code might want to take a > look at <URL:http://www.dx0.org/>. This is a cross-browser > library with > a difference: it uses server-side technology to detect which > browser is > making the connection, then it delivers JavaScript targeted to that > particular browser. It can be done with server side technology, but a client side solution seems to me better. It only waste server time to produce specific JavaScript file. If the files are split, we can also keep in an OO way. For example, we can use Factory pattern: the DynLayer with all code same for all browsers and versions; DynLayerNN and DynLayerIE inherit DynLayer and with general code for all version; and DynLayerNN_4, ... with NN4 specific code. A DynLayerFactory object detects browser and version, return the corresponding sub-class object of DynLayer and it is transparent to the user of DynLayer. Although there are a lot interesting or important things to do, splitting code into browser and version specific seems to be the hotest theme. :) |