var ISearch = ISearch || {}; var b_line_sta_click = false; ISearch.setup = function(textfield, callback, options) { var timer = null, lastInput = ''; wait = 500; minLength = 0; if (options !== undefined) { wait = options.wait; minLength = options.minLength; } textfield.on('keyup change', function() { var input = $.trim($(this).val()); if (lastInput !== input && input.length >= minLength) { clearTimeout(timer); timer = setTimeout(function() { callback(input); }, wait); } lastInput = input; }); }; $(function() { // 沿線、駅取得 ISearch.setup($('#line_sta_inp'), function(input) { b_line_sta_click = false; $('#line_sta_sel_box').hide(); $('#lin').val(''); $('#sta').val(''); $.get('/search/line_sta_sub.php', { q: $('#line_sta_inp').val() } ).done(function( json_data ) { if(json_data !== null){ var tmp_html = '