function check_id() { $.ajax({ type: 'GET', url: '/search_db/check_id/3', success: function( data ){ console.log( data ); } }); alert( 'hallo' ); };