我们移动了JS,现在搜索框提交仅附加到/ URL。它曾经在某一时刻工作,现在我们不确定是什么原因导致页面重新加载而不是提交搜索。
if (document.body.contains(document.getElementById("pagePublicHome"))) {
document.getElementById("search-container").style.display = "inline";
(function addSearch() {
var htm = '<form class="search-form" id="search-form"><label for="quick-search">BECOME MORE</label><span class="search-btn-span" id="search-btn-span"><input id="quick-search" class="form-control" placeholder="Search Course Number, Title, or Keyword..." name="query"><button type="submit" class=""><span class="glyphicon-search glyphicon"></span></button></span></form>';
document.getElementById("search-container").innerHTML = htm;
})();
$("#search-form").submit(function (e) {
qry = $(this).find("input")[0].value;
if (qry !== "") {
window.location.href = "/search/publicCourseAdvancedSearch.do?method=doPaginatedSearch&showInternal=false&cspIndex=true&isPageDisplayed=true&courseSearch.courseDescriptionKeyword=" + qry;
} else {
$(this).find("input")[0].placeholder = "search cannot be blank...";
$("#search-form").find("input").on("focus", function () {
$(this).off("focus");
$("#search-form").find("input")[0].placeholder = "search courses...";
});
}
e.preventDefault();
});
$.each($("div.image>img"), function (i, x) {
$(this).parent().css({
"background-image": "url(" + $(this).attr("src") + ")"
});
$(this).siblings("div.overlay").css("background-color", "#FFFFFF00");
});
}