-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsearch.js
More file actions
53 lines (51 loc) · 1.87 KB
/
Copy pathsearch.js
File metadata and controls
53 lines (51 loc) · 1.87 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
$(document).ready(function () {
$('#searchit').submit(function(){
let btn = true;
let k = $('#searchit input');
if($.trim(k.val()) == ""){
k.css("border", "1px solid red")
btn = false;
}
else{
k.css("border", "1px solid #ccc")
}
if(btn){
let data = k.val();
$.ajax({
type: "POST",
url: "search2.php",
data: {"k" : data},
beforeSend: function(){
$('#searchit button').html("Searching....");
$('#searchit button').attr("disabled", true);
},
success: function (data) {
$('#searchit button').html("Search");
$('#searchit button').attr("disabled", false);
$('.result').html(data);
console.log(data)
var img = [];
$('.images_table').find('tr').each(function(){
$(this).find('td').each(function(){
let im = $(this).find('img').attr("src");
img.push(im);
})
});
$('.result').html("");
var thdata = "";
$.each(img, function(ind, ele){
thdata += '<img src="'+ele+'" >';
})
$('.result').html(thdata);
console.log(img)
// $('body').find('#desktop-search #leftnav').html("")
// $('body').find('#desktop-search #leftnav').hide();
// $('#gbg').hide();
// $('#gbz').hide();
// $('body').find('#mn tbody[id != "desktop-search"]').hide();
}
});
}
return false;
})
});