bugfix : "illegal argument" in jQuery.style(), try-catch fixes it.

bugfix : "illegal argument" in jQuery.style(), try-catch fixes it.

Hi.

My CMS does some magic with the jQuery.dialog code, and apparently deepcalls jQuery.style() in a way that results in el.style[name] = 'NaNpx'. Firefox will not die on it, but IE does, nitpick that it is.

It's closed source, so i won't be sharing any urls with you at this time, sorry.

Anyways, the solution is another try-catch structure, starting at line 4617.

Constantly fixing these types of jquery-related bugs in my CMS during development of features is timeconsuming. Many browsers, each with different developer tools that are not always easy to use.

It's much faster to get jQuery to be more robust, and -ideally- let it do some deep-reporting of it's own.

the old:
        if ( set ) {
            style[ name ] = value;
        }

IE fix code:
        if ( set ) {
            try {
            style[ name ] = value;
            } catch(e) {};
        }

so perhaps even better fix code would do a full report on the error;

        if ( set ) {
            try {
            style[ name ] = value;
            } catch(e) { jQuery.log ('jQuery.style', {elem:elem,name:name,value:value});
        }

jQuery.extend (jQuery, {
  log : function (fn, ctx) { // mockup
    if (typeof console=='object' && typeof console.log=='function') {
      var msg = fn+'() : ';
      for (n in ctx) {
        msg += n + '=' + ctx[n] + ', ';
      };
      console.log (msg);
      if (typeof console.trace=='function') console.trace();
    }
  }
});