[jQuery] Had to add a few lines to 1.2.3 core file (fix IE7 and "invalid argument" for .attr method)

[jQuery] Had to add a few lines to 1.2.3 core file (fix IE7 and "invalid argument" for .attr method)


I can't seem to find any talk/reference on this exact error, but in
the jQuery core file at line 1298 (inside the "attr" function)
the line
====================================
elem[ name ] = value;
====================================
was throwing an error in IE7, preventing some other script-related
things from working
Using both Visual Studio 2008 (to debug IE) and Firebug (to follow
along what was happening in FF)
turns out "NaN" and "NaNpx" were respectively being passed into this
function from two plugins i am using ("ui.datepicker" and "clickmenu")
Saw that value come through in FF, and the browser just ignored it....
but when that value came down in IE7, its much worse as it throws a
script error.... in the case of trying to "close" the Datepicker,
this error prevented that close action from taking place, in the case
of the menu, it was able to get by it and still work (but still
presented the yellow alert in the bottom left of IE)
Anyways, i added a few lines to the core, so that it is now like:
====================================
var FixedValue = "" + value;
if (FixedValue.length >= 3 && FixedValue.substr(0,3) == "NaN") { value
= ""; }
if ( value != undefined )
elem[ name ] = value;
return elem[ name ];
====================================
And now my menu works without throwing the error and, more
importantly, the DatePicker closes properly....
I guess my questions to the group are:
1) Has anyone seen this error from either of these plugins in IE7?
2) Think my 'fix' is low impact enough that I shouldn't worry about
other things getting affected?
btw, even this super stripped down page displays the error here on IE7
====================================
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Date Pick</title>
<script src="../ScriptLibrary/jQuery/1.2.3/jquery.js" type="text/
javascript"></script>
<link href="../ScriptLibrary/jQuery/plugins/ui.datepicker.css"
rel="stylesheet" type="text/css" />
<script src="../ScriptLibrary/jQuery/plugins/ui.datepicker.js"
type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function() {
$(".Date").datepicker();
});
</script>
</head>
<body>
<div><input type="text" class="Date" /></div>
</body>
</html>
====================================