I have a question about autocomplete,I want to change the value of SELECT, will change the remote access to the file, why the error?

I have a question about autocomplete,I want to change the value of SELECT, will change the remote access to the file, why the error?

<select id='sd'>
  <option value ="111">aaa</option>
  <option value ="222">bbb</option>
  <option value="333">ccc</option>
  <option value="444">ddd</option>
</select>
<input type='text' id='mecode'>
<script> $( function() {
 
function log( message ) {
$( "<div>" ).text( message ).prependTo( "#log" );
$( "#log" ).scrollTop( 0 );
}
      var file=("#select1  option:selected").val();+'jsp'
$( "#mecode" ).autocomplete({
source: function( request, response ) {
$.ajax( {
url: file,
dataType: "jsonp",
data: {
term: request.term
},
success: function( data ) {
response( data );
}
} );
},
minLength: 2,
select: function( event, ui ) {
log( "Selected: " + ui.item.value + " aka " + ui.item.id );
}
} );
} );
  </script>
I want to change the value of SELECT, will change the remote access to the file, why the error?