title: Javascript split() not working in IE
body: <p>Lets say I have a <strong>textarea</strong> with this text:</p>
  
  <ol>
  <li>first line some text.</li>
  <li>second line, other text. next line will be empty.</li>
  <li><em>(empty line)</em></li>
  <li><em>(empty line)</em></li>
  <li>last line here</li>
  </ol>
  
  <p>As you can see, lines 3 and 4 are empty (<code>\n</code>). I need to get the exact lines structure (with empty lines as well) and convert it to an array. Each line is an element of the array. This is my current code:</p>
  
  <pre><code>var lines = $('#q').val().split(/\n/);
  alert(lines.length); //using alert() because IE doesn't support console.log()
  var texts = [];
  for(i = 0; i &lt; lines.length; i++) {
      texts.push($.trim(encodeURIComponent(lines[i])));
  }
  </code></pre>
  
  <p>It works great on all browsers, except IE. For some reason, the <strong>split()</strong> function ignores empty lines (3 and 4) in IE. Because of that, they are never passed into the array :s</p>
  
  <p><strong>Solution</strong> by <a href="https://stackoverflow.com/users/62076/squeegy">Squeegy</a> in the comments</p>
  
  <p>Replace <code>split(/\n/)</code> with <code>split("\n")</code> - damn you IE!</p>