Skip to content

Instantly share code, notes, and snippets.

@flexchar
Created November 14, 2019 10:41
Show Gist options
  • Save flexchar/334b2c28571a70f5b3a5dbdd937cf414 to your computer and use it in GitHub Desktop.
Save flexchar/334b2c28571a70f5b3a5dbdd937cf414 to your computer and use it in GitHub Desktop.
List of courses for my exchange at EUC :)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<title>Courses for exchange at EUC</title>
</head>
<body>
<div data-courses>
<h2>Courses for exchange at EUC</h2>
</div>
<script>
// Courses for EUC
const courses = {
'Data mining and web mining': 'CSW431',
'Web Engineering': 'CSW441',
'Web Technologies': 'CSC133',
'Public Speaking': 'COM101',
'Web Programming': 'CSC209',
'Software Engineering I': 'CSC411',
'Software Engineering II': 'CSC412',
'Search Engine Optimization and Internet Marketing': 'CSC233',
'Introduction to Financial Accounting': 'ACC112',
'Advanced Web Applications': 'CSW361',
'Developing Web Applications': 'CSW251',
'Production and Operations Management': 'MGT203',
'Emergency Response & CSR': 'AVM411',
};
const getCoursePDF = id => `https://syllabus.euc.ac.cy/en/${id}.pdf`;
function showCourses() {
const placeholder = document.querySelector('[data-courses]');
const ul = document.createElement('ul');
Object.keys(courses).map(title => {
const id = courses[title];
const li = document.createElement('li');
const a = document.createElement('a');
a.href = getCoursePDF(id);
a.innerText = `${title} Course ${id}`;
a.target = '_blank';
li.appendChild(a);
ul.appendChild(li);
});
placeholder.appendChild(ul);
}
showCourses();
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment