Skip to content

Commit

Permalink
Fix for knockout#452: setElementName error IE9 in compatibility mode
Browse files Browse the repository at this point in the history
  • Loading branch information
mbest committed Jul 3, 2012
1 parent 67815fb commit 0b21a26
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/utils.js
Expand Up @@ -321,8 +321,12 @@ ko.utils = new (function () {
// Workaround IE 6/7 issue
// - https://github.com/SteveSanderson/knockout/issues/197
// - http://www.matts411.com/post/setting_the_name_attribute_in_ie_dom/
if (ieVersion <= 7)
element.mergeAttributes(document.createElement("<input name='" + element.name + "'/>"), false);
if (ieVersion <= 7) {
try {
element.mergeAttributes(document.createElement("<input name='" + element.name + "'/>"), false);
}
catch(e) {}
}
},

forceRefresh: function(node) {
Expand Down

0 comments on commit 0b21a26

Please sign in to comment.