mirror of
https://github.com/quatalog/site.git
synced 2024-11-01 12:34:16 +00:00
17 lines
738 B
JavaScript
17 lines
738 B
JavaScript
|
const search_helper = function() {
|
||
|
const input = document.getElementById("search").value;
|
||
|
console.log(input);
|
||
|
/*
|
||
|
const courseCodeInput = elem.value.replace(" ", "").replace("-", "");
|
||
|
const subCode = courseCodeInput.substring(0,4).toUpperCase();
|
||
|
const courseNum = courseCodeInput.substring(courseCodeInput.length-4,courseCodeInput.length);
|
||
|
if(`${subCode}-${courseNum}` in catalog){
|
||
|
// course exists
|
||
|
window.location.href = "./coursedisplay.html?course="+subCode+"-"+courseNum;
|
||
|
} else {
|
||
|
// course doesn't exist
|
||
|
window.location.href = "./search.html?search="+encodeURIComponent(elem.value);
|
||
|
showSearchResults();
|
||
|
}*/
|
||
|
}
|