jQuery-1.2.6.js IE work-around (set attribute race condition)

jQuery-1.2.6.js IE work-around (set attribute race condition)


With jQuery 1.2.6 I noticed that IE 6 at least has a race condition
problem with setting certain attributes where I would intermittently
get the error message of "Could not set the selected property.
Unspecified error." on lines 15 and 23. (First seen with select
boxes.) Per post: http://bytes.com/forum/thread150463.html, I made
two modifications to the jQuery core file to successfully work around
my particular issue:
line #15: replaced
"this.selected=(jQuery.inArray(this.value,values)>=0||
jQuery.inArray(this.text,values)>=0);" with
"try{this.selected=(jQuery.inArray(this.value,values)>=0||
jQuery.inArray(this.text,values)>=0);}catch(e)
{this.setAttribute('selected',(jQuery.inArray(this.value,values)>=0||
jQuery.inArray(this.text,values)>=0));}"
line #23: replaced first instance of "elem[name]=value;" with
"try{elem[name]=value;}catch(e){elem.setAttribute('name',value);};"