quatalog-site/js/search_helper.js

17 lines
738 B
JavaScript
Raw Normal View History

2023-02-10 20:50:06 +00:00
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();
}*/
}