SteveSanderson/knockout — Issue #186: Binding throws error in IE when using negated conditional comments
Author: SteveSanderson
Created: 2011-10-31 12:23:19+00:00
State: open
Labels: 1.3.0

If you have IE conditional comments like this:

which is apparently the recommended syntax for telling IE9+ and non-IE browsers to load a certain script, then data binding fails in IE (OK on other browsers though).

The error message that IE gives is, nonsensically, "Not enough storage is available to complete this operation". The failure occurs on ko 1.3 beta debug lines 1392 and 1396, because IE 9 parses the above as a pair of empty comment tags like , and apparently for such nodes you're not allowed to ask about node.nodeValue, otherwise you get the "not enough storage" error.

Makes no sense, but can be solved by explicitly checking whether

node.text === ""

... and if so, don't ask about node.nodeValue.