Added example HTML Page
This commit is contained in:
parent
9b0e31a623
commit
016138e6f3
47
index.html
Normal file
47
index.html
Normal file
@ -0,0 +1,47 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Discovery Example</title>
|
||||
</head>
|
||||
<body>
|
||||
<div>
|
||||
<h1>Neuerscheinungen</h1>
|
||||
<ul id="books">
|
||||
</ul>
|
||||
</div>
|
||||
<script>
|
||||
let items = ["Allgemeines, Umweltschutz, Spielfilme",
|
||||
"Theologie, Philosophie, Ethik, Psychologie",
|
||||
"Pädagogik",
|
||||
"Germanistik, Sprach- und Literaturwissenschaft"]
|
||||
let books = document.getElementById('books')
|
||||
|
||||
items.forEach(buildLink)
|
||||
|
||||
// create new li element and text node
|
||||
// append it to list element
|
||||
function buildLink(value, index) {
|
||||
|
||||
const zeroPad = (num, places) => String(num).padStart(places, '0')
|
||||
const d = new Date()
|
||||
let year = d.getFullYear()
|
||||
let month = d.getMonth()
|
||||
let link = "https://fhnw.swisscovery.slsp.ch/discovery/search?query=any,contains,(" +
|
||||
"ENE60" + year + zeroPad(month + 1, 2) + zeroPad(index + 1, 2) +
|
||||
"+OR+ENE60" + year + zeroPad(month, 2) + zeroPad(index + 1, 2) +
|
||||
"+OR+ENE60" + year + zeroPad(month - 1, 2) + zeroPad(index + 1, 2) +
|
||||
")&tab=41SLSP_FHNW_MyInst_and_CI&search_scope=MyInst_and_CI" +
|
||||
"&vid=41SLSP_FNW:VU1&offset=0"
|
||||
|
||||
let item = document.createElement("li")
|
||||
let aElement = document.createElement("a")
|
||||
let content = document.createTextNode(value)
|
||||
aElement.appendChild(content)
|
||||
aElement.setAttribute("href", link)
|
||||
item.appendChild(aElement)
|
||||
books.appendChild(item)
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Loading…
Reference in New Issue
Block a user