Skip to content
Permalink
Browse files

Fix for #883

  • Loading branch information
jzaefferer committed Jan 31, 2007
1 parent 4e256bf commit a82b048db8c72dccb019e086e0ca50617df14915
Showing with 4 additions and 2 deletions.
  1. +3 −1 src/jquery/coreTest.js
  2. +1 −1 src/jquery/jquery.js
@@ -102,14 +102,16 @@ test("attr(Hash)", function() {
});

test("attr(String, Object)", function() {
expect(6);
expect(7);
var div = $("div");
div.attr("foo", "bar");
var pass = true;
for ( var i = 0; i < div.size(); i++ ) {
if ( div.get(i).getAttribute('foo') != "bar" ) pass = false;
}
ok( pass, "Set Attribute" );

ok( $("#foo").attr({"width": null}), "Try to set an attribute to nothing" );

$("#name").attr('name', 'something');
ok( $("#name").attr('name') == 'something', 'Set name attribute' );
@@ -1281,7 +1281,7 @@ jQuery.extend({
var exclude = /z-?index|font-?weight|opacity|zoom|line-?height/i;

// Handle passing in a number to a CSS property
if ( value.constructor == Number && type == "curCSS" && !exclude.test(prop) )
if ( value && value.constructor == Number && type == "curCSS" && !exclude.test(prop) )
return value + "px";

return value;

0 comments on commit a82b048

Please sign in to comment.
You can’t perform that action at this time.