{"id":85,"date":"2014-03-21T12:16:18","date_gmt":"2014-03-21T11:16:18","guid":{"rendered":"http:\/\/www.vosseburcht.com\/?p=85"},"modified":"2014-03-21T12:16:18","modified_gmt":"2014-03-21T11:16:18","slug":"is-your-knockoutjs-options-binding-working-on-ie11-but-not-on-ie8","status":"publish","type":"post","link":"https:\/\/vosseburchttechblog.azurewebsites.net\/index.php\/2014\/03\/21\/is-your-knockoutjs-options-binding-working-on-ie11-but-not-on-ie8\/","title":{"rendered":"Is your KnockoutJS &#8216;options&#8217; binding working on IE11 but not on IE8?"},"content":{"rendered":"<p>I had this issue, and since I am not a javascript expert, it took me a while to figure this out.<\/p>\n<p>If you are binding to a static array (declared in code) like such:<\/p>\n<pre style=\"width: 414px; height: 81px;\">self.statusOptions\u00a0=\u00a0[\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0{\u00a0name:\u00a0\"Option\u00a01\",\u00a0id:\u00a01\u00a0},\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0{\u00a0name:\u00a0\"Option\u00a02\",\u00a0id:\u00a02\u00a0},\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0{\u00a0name:\u00a0\"Option\u00a03\",\u00a0id:\u00a03\u00a0},\n\u00a0\u00a0\u00a0\u00a0];<\/pre>\n<p>This will go horribly wrong because the that final comma. In IE 8 this means there is another, empty, item in the array. In IE11 this seems to work fine. So change it to this and you are good to go:<\/p>\n<pre>self.statusOptions\u00a0=\u00a0[\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0{\u00a0name:\u00a0\"Option\u00a01\",\u00a0id:\u00a01\u00a0},\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0{\u00a0name:\u00a0\"Option\u00a02\",\u00a0id:\u00a02\u00a0},\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0{\u00a0name:\u00a0\"Option\u00a03\",\u00a0id:\u00a03\u00a0}\n\u00a0\u00a0\u00a0\u00a0];<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>I had this issue, and since I am not a javascript expert, it took me a while to figure this out. If you are binding to a static array (declared in code) like such: self.statusOptions\u00a0=\u00a0[ \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0{\u00a0name:\u00a0&#8220;Option\u00a01&#8221;,\u00a0id:\u00a01\u00a0}, \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0{\u00a0name:\u00a0&#8220;Option\u00a02&#8221;,\u00a0id:\u00a02\u00a0}, \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0{\u00a0name:\u00a0&#8220;Option\u00a03&#8221;,\u00a0id:\u00a03\u00a0}, \u00a0\u00a0\u00a0\u00a0]; This will go horribly wrong because the that final comma. In IE 8 this means there [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/vosseburchttechblog.azurewebsites.net\/index.php\/wp-json\/wp\/v2\/posts\/85"}],"collection":[{"href":"https:\/\/vosseburchttechblog.azurewebsites.net\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/vosseburchttechblog.azurewebsites.net\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/vosseburchttechblog.azurewebsites.net\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/vosseburchttechblog.azurewebsites.net\/index.php\/wp-json\/wp\/v2\/comments?post=85"}],"version-history":[{"count":0,"href":"https:\/\/vosseburchttechblog.azurewebsites.net\/index.php\/wp-json\/wp\/v2\/posts\/85\/revisions"}],"wp:attachment":[{"href":"https:\/\/vosseburchttechblog.azurewebsites.net\/index.php\/wp-json\/wp\/v2\/media?parent=85"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/vosseburchttechblog.azurewebsites.net\/index.php\/wp-json\/wp\/v2\/categories?post=85"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/vosseburchttechblog.azurewebsites.net\/index.php\/wp-json\/wp\/v2\/tags?post=85"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}