This code produces no errors:
function func() {
  xmlhttp.onreadystatechange = function stateChanged() {
    if (xmlhttp.readyState == 4) {
      /* stuff happens herer */
    }
  }
  func2(xmlhttp)
}
If I put all put all the code on a single line I get SyntaxError: unexpected token: identifier
function func() { xmlhttp.onreadystatechange = function stateChanged() { if (xmlhttp.readyState == 4) { /* stuff happens herer */ } } func2(xmlhttp) }
What difference does a single line make?
 
    