PageSourceSearch

https://digital-watchdog.com/js/auto-suggest-pages.js?20260924153115

js digital-watchdog.com collected 2026-09-24 22:31:52 UTC 1,565 bytes, 54 lines download raw bytes

1
2$(document).ready(function(e) {   
3	// Auto Search Options:
4	var globalSearchInput = $('#page_auto_suggest .page_global_search'),
5		globalSearchSuggestion = $('#page_auto_suggest .product_search_suggestion'),
6		globalSearchValue = '',
7		globalSearchTimeout;
8
9	globalSearchInput.keyup(function(e){
10		if(e.which==13){
11			e.preventDefault();
12			let val = $(e.target).val().trim();
13			if(val!=''){
14				let url = location.protocol+'//'+location.host+'/search-result/?keywords='+val;
15				window.location.href = url;
16			}
17		}else{
18			globalSearchValue = globalSearchInput.val();
19			if(globalSearchValue=='') globalSearchSuggestion.html('');
20			else searhSuggest(globalSearchValue);
21		}
22	});
23	$('#page_auto_suggest .i-global-search').click(function(e){
24		e.preventDefault();
25		let val = globalSearchInput.val().trim();
26		if(val!=''){
27			let url = location.protocol+'//'+location.host+'/search-result/?keywords='+val;
28			window.location.href = url;
29		}
30	});
31
32	function searhSuggest(search){
33		if(search.trim()!=''){
34			$.ajax({
35				type: 'POST',
36				url: location.protocol+'//'+location.host+'/models/products-select-options-gen.php',
37				data: 'search='+search,
38				success: function(gridData){
39					if(globalSearchValue!='') globalSearchSuggestion.html(gridData);
40				}
41			});
42		}
43	}
44	globalSearchSuggestion.mouseup(function(e){
45		globalSearchTimeout = setTimeout(function(){
46			//globalSearchSuggestion.html('');
47		}, 500);
48	});
49	
50	$(document).on('click', function () {
51		globalSearchSuggestion.html('');
52	});
53	
54});

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.