The problem is that any </ sequence known as ETAGO terminates a CDATA element, such as <script> . You can get away with </ in browsers, but not </script .
The simplest workaround is splitting the sequence </ using a backslash-escape:
sel.append('<option value="' + data[i].id + '">' + data[i].nombre + '<\/option>');
However, this line still has problems because you are not using the id and nombre HTML tags. If they can contain < , & or " , you just created a client-side XSS vulnerability!
This way, either HTML-escape your text values ββbefore putting them in strings, or, more simply put, just use the standard DOM:
sel.append (new option (data [i] .nombre, data [i] .id));
source share