Forum Discussion
Launch page with multiple buttons
Is it at all possible to make a launch page with several links which all open a different course, utilising the script from launcher.html?
I'd like to have a page that looks something like this, but then have each link open in a new window, exactly like launcher.html does.
Looking at the code, the only possibility I see now is to add that entire script to each link, but to give the function a different name for each link ("LaunchContent1()", "LaunchContent2()", etc).
I can't imagine there isn't a better option, but this script way surpasses my knowledge, so any help will be greatly appreciated :)
- diana45petersCommunity Member
You can definitely create a launch page with multiple buttons by using a single JavaScript function to open different links in new windows. Here's a simplified example:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Launch Page</title>
<script>
function launchContent(courseUrl) {
window.open(courseUrl, '_blank', 'toolbar=0,location=0,menubar=0');
}
</script>
</head>
<body>
<button onclick="launchContent('course1.html')">Launch Course 1</button>
<button onclick="launchContent('course2.html')">Launch Course 2</button>
<button onclick="launchContent('course3.html')">Launch Course 3</button>
</body>
</html>This script simplifies the process by using a common function to open each link in a new window
- Alma219WayCommunity Member
You can create a launch page with several links opening different courses in new windows by using a single function. Here's a simplified example:
html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Course Launcher</title>
<script>
function launchCourse(courseUrl) {
window.open(courseUrl, '_blank');
}
</script>
</head>
<body>
<h1>Select a Course</h1>
<ul>
<li><a href="javascript:launchCourse('course1.html');">Course 1</a></li>
<li><a href="javascript:launchCourse('course2.html');">Course 2</a></li>
<li><a href="javascript:launchCourse('course3.html');">Course 3</a></li>
</ul>
</body>
</html>
This method avoids duplicating the script and keeps your code clean.