> It is a bad idea because there is no such thing as foolproof browser
> sniffing.
> The only way to know what the browser can do is to test its features,
> and loading a piece of script for every feature implementation
> specific to a browser completely kills the benefit of loading less
> script.

Unless you create as much files as there are features support
combinaisons, or you create it once on-the-fly when you have a
combinaison that has never been encountered.

The main reason I was asking for that was not because I wanted to
download a lighter file, but because I didn't wanted at each
iteration  tests which could be done once.

Another way would be to download the entire script, but to do like
that :

in spite of
o.setClass = function( class ) {
  if( isGoodDOM() ) {
     this.setAttribute( 'class', class );
  }
  else {
     this.setAttribute( 'className', class );
  }
}


to do
if( isGoodDOM() ) {
o.setClass = function( class ) {
     this.setAttribute( 'class', class );
  }
}
else {
o.setClass = function( class ) {
     this.setAttribute( 'className', class );
  }
}

---
Ludovic
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"jQuery Development" group.
To post to this group, send email to jquery-dev@googlegroups.com
To unsubscribe from this group, send email to 
jquery-dev+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/jquery-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to