@@ -202,10 +202,28 @@
|
|||||||
window.location.href = `certificate.html?id=${id}`;
|
window.location.href = `certificate.html?id=${id}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function initializeSearchTermFromUrl() {
|
||||||
|
const params = new URLSearchParams(window.location.search);
|
||||||
|
const presetTerm =
|
||||||
|
params.get('searchTerm') ||
|
||||||
|
params.get('term') ||
|
||||||
|
params.get('keyword') ||
|
||||||
|
params.get('cert_number') ||
|
||||||
|
params.get('certNumber') ||
|
||||||
|
params.get('number') ||
|
||||||
|
params.get('q') ||
|
||||||
|
'';
|
||||||
|
|
||||||
|
if (presetTerm) {
|
||||||
|
document.getElementById('searchTerm').value = presetTerm;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
document.getElementById('searchBtn').addEventListener('click', handleSearch);
|
document.getElementById('searchBtn').addEventListener('click', handleSearch);
|
||||||
document.getElementById('searchTerm').addEventListener('keypress', e => {
|
document.getElementById('searchTerm').addEventListener('keypress', e => {
|
||||||
if (e.key === 'Enter') handleSearch();
|
if (e.key === 'Enter') handleSearch();
|
||||||
});
|
});
|
||||||
|
initializeSearchTermFromUrl();
|
||||||
</script>
|
</script>
|
||||||
<script src="https://cdn.jsdmirror.cn/gh/bishshi/wechat-detect@main/wechat-detect.js"></script>
|
<script src="https://cdn.jsdmirror.cn/gh/bishshi/wechat-detect@main/wechat-detect.js"></script>
|
||||||
</body>
|
</body>
|
||||||
|
|||||||
@@ -203,7 +203,25 @@
|
|||||||
resultsDiv.innerHTML = html;
|
resultsDiv.innerHTML = html;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function initializeSearchTermFromUrl() {
|
||||||
|
const params = new URLSearchParams(window.location.search);
|
||||||
|
const presetTerm =
|
||||||
|
params.get('searchTerm') ||
|
||||||
|
params.get('term') ||
|
||||||
|
params.get('keyword') ||
|
||||||
|
params.get('ticket_number') ||
|
||||||
|
params.get('ticketNumber') ||
|
||||||
|
params.get('number') ||
|
||||||
|
params.get('q') ||
|
||||||
|
'';
|
||||||
|
|
||||||
|
if (presetTerm) {
|
||||||
|
document.getElementById('searchTerm').value = presetTerm;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
document.getElementById('searchBtn').addEventListener('click', handleSearch);
|
document.getElementById('searchBtn').addEventListener('click', handleSearch);
|
||||||
|
initializeSearchTermFromUrl();
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
Reference in New Issue
Block a user