-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.js
31 lines (29 loc) · 867 Bytes
/
index.js
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
window.onload = main
function main()
{
document.getElementById("searchButton").onclick = function()
{
var pName = document.getElementById("personName").value;
var tName = document.getElementById("toyName").value;
var cName = document.getElementById("companyName").value;
if(pName != "")
{
console.log("person");
window.location.href = "./browse?category=people&name=" + pName;
}
else if (tName != "")
{
console.log("toy");
window.location.href = "./browse?category=toys&name=" + tName;
}
else if (cName != "")
{
console.log("company");
window.location.href = "./browse?category=companies&name=" + cName;
}
else
{
console.log("error");
}
}
}