javascript / ajax / json中的错误

im gettin an error with this code. the error is : "Uncaught SyntaxError: Unexpected end of input" THIS IS MY FUNCTION

function buscarMaterias()
{
  var primeraVez = true;
  var desarolloMaterias;
  var infraMaterias;
  var value = sel.value;
  var ajax = new XMLHttpRequest();
  console.log(1+1);
    if(primeraVez)
  {
    console.log(1+2);
    ajax.open('GET', 'desarrollo.json');
    ajax.send();
    desarolloMaterias = JSON.parse(ajax.responseText);
    ajax.open('GET', 'infraestructura.json');
    ajax.send(); 
    infraMaterias = JSON.parse(ajax.responseText);
    primeraVez = false;
  }
  console.log(1+3);
  switch(value)
  {
  case "1":
    dibujarMaterias(desarolloMaterias);
    break;
  case "2":
    dibujarMaterias(infraMaterias); 
    break;
    default:
    dibujarMaterias([{"id":0,"descripcion":"ELIGE UNA CARRERA"}]);
  }

}

i know the error is from a missing {,;] etc, but i just cant get where is a missing character

You may have more errors, but this is one's for sure:

In this line:

var value = sel.value;

because sel is not defined.

I used the javascript console and got that error:

Uncaught ReferenceError: sel is not defined(…)

Use the javascript console for the browser you are using. I'm using Chrome's, but FF and IE have the same thing.