aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Browser.js2
-rw-r--r--src/jqLite.js2
-rw-r--r--src/widgets.js5
3 files changed, 5 insertions, 4 deletions
diff --git a/src/Browser.js b/src/Browser.js
index e00f73a5..11b079f0 100644
--- a/src/Browser.js
+++ b/src/Browser.js
@@ -9,7 +9,7 @@ function Browser(location, document) {
this.urlListeners = [];
this.hoverListener = noop;
- this.XHR = XMLHttpRequest || function () {
+ this.XHR = window.XMLHttpRequest || function () {
try { return new ActiveXObject("Msxml2.XMLHTTP.6.0"); } catch (e1) {}
try { return new ActiveXObject("Msxml2.XMLHTTP.3.0"); } catch (e2) {}
try { return new ActiveXObject("Msxml2.XMLHTTP"); } catch (e3) {}
diff --git a/src/jqLite.js b/src/jqLite.js
index 0867f9c9..36248e71 100644
--- a/src/jqLite.js
+++ b/src/jqLite.js
@@ -187,7 +187,7 @@ JQLite.prototype = {
} else {
var attributes = e.attributes,
item = attributes ? attributes.getNamedItem(name) : undefined;
- return item ? item.value : undefined;
+ return item && item.specified ? item.value : undefined;
}
},
diff --git a/src/widgets.js b/src/widgets.js
index 2c084e29..239f12f8 100644
--- a/src/widgets.js
+++ b/src/widgets.js
@@ -45,10 +45,11 @@ function valueAccessor(scope, element) {
if (error !== lastError || force) {
elementError(element, NG_VALIDATION_ERROR, error);
lastError = error;
- if (error)
+ if (error) {
invalidWidgets.markInvalid(element);
- else
+ } else {
invalidWidgets.markValid(element);
+ }
}
return value;
}