-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathclient.js
More file actions
35 lines (32 loc) · 1.07 KB
/
client.js
File metadata and controls
35 lines (32 loc) · 1.07 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
$(document).ready(function(){
var i=0;
$("#search").click(function(){
var data=$("#text").val();
$.ajax({
type : 'post',
url : "http://localhost:3000/post",
dataType : "json",
data : {str:data},
crossDomain : true,
success: function(val,err) {
if(val.length==0)
alert("No Results Found");
else
{
for(i=0;i<val.length;i++)
{
var str=val[i].split('\r\n');
var str1='';
for(j=0;j<str.length;j++)
str1+=str[j]+'<br/>';
$("#cent").css("border", "5px solid black");
$("#cent").append($("<table ><tr ><td style='padding:0px'><img src='docs.png' ></td><td><p>"+str1+"</p></td></tr><table><hr>").fadeIn('slow'));
}
}
}
}
);
}
);
}
);