NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

Creating a front-end page involves HTML, CSS, and potentially JavaScript. Here's a simple HTML template to display the upcoming events:

```html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Upcoming Events</title>
<style>
/* Add your CSS styling here */
body {
font-family: Arial, sans-serif;
margin: 20px;
}

.event-container {
border: 1px solid #ccc;
padding: 10px;
margin-bottom: 10px;
}
</style>
</head>
<body>

<h1>Upcoming Events</h1>

<div id="eventsContainer">
<!-- Events will be dynamically added here -->
</div>

<script>
// Use JavaScript to fetch and display events
document.addEventListener('DOMContentLoaded', function () {
// Fetch upcoming events from the API
fetch('/api/event/upcoming')
.then(response => response.json())
.then(events => {
// Display events on the page
const eventsContainer = document.getElementById('eventsContainer');
events.forEach(event => {
const eventDiv = document.createElement('div');
eventDiv.classList.add('event-container');
eventDiv.innerHTML = `<h3>${event.name}</h3><p>${event.date}</p>`;
eventsContainer.appendChild(eventDiv);
});
})
.catch(error => console.error('Error fetching upcoming events:', error));
});
</script>

</body>
</html>
```

This is a basic template. Adjust the CSS and modify the JavaScript section based on the structure of your API response. Also, co


nsider using a front-end framework like React, Angular, or Vue.js for more complex appli
cations.

To show the username on the redirected page, you can pass the username as a parameter in the URL or use other methods like local storage or session storage. Here's an example of how you might pass it as a parameter in the URL:

Update your login success section in the JavaScript code:

```javascript
success: function(data) {
// Check if login was successful
if (data === "Login successful") {
// Redirect to the event login page and pass the username as a parameter
alert("Login successful");
window.location.href = `eventLoginPage.html?username=${encodeURIComponent(username)}`;
} else {
// Login failed, show an alert or handle accordingly
alert("Login failed. Please check your credentials.");
}
},
```

Then, on the `eventLoginPage.html`, you can retrieve the username from the URL and display it:

```javascript
document.addEventListener('DOMContentLoaded', function () {
// Get the username parameter from the URL
const urlParams = new URLSearchParams(window.location.search);
const username = urlParams.get('username');

// Display the username on the page
const usernameElement = document.getElementById('username');
if (usernameElement) {
usernameElement.textContent = `Welcome, ${username}!`;
}
});
```

Make sure you have an element with the id `username` on your `eventLoginPage.html` where you want to display the username:

```html
<!-- eventLoginPage.html -->

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Event Login Page</title>
</head>
<body>

<div id="username"></div>

<!-- Other content of your page -->

<script src="your-jquery-library.js"></script>
<script src="your-script.js"></script>
</body>
</html>
```

Adjust the code based on your actual page structure and requirements.
     
 
what is notes.io
 

Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...

With notes.io;

  • * You can take a note from anywhere and any device with internet connection.
  • * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
  • * You can quickly share your contents without website, blog and e-mail.
  • * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
  • * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.

Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.

Easy: Notes.io doesn’t require installation. Just write and share note!

Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )

Free: Notes.io works for 12 years and has been free since the day it was started.


You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;


Email: [email protected]

Twitter: http://twitter.com/notesio

Instagram: http://instagram.com/notes.io

Facebook: http://facebook.com/notesio



Regards;
Notes.io Team

     
 
Shortened Note Link
 
 
Looding Image
 
     
 
Long File
 
 

For written notes was greater than 18KB Unable to shorten.

To be smaller than 18KB, please organize your notes, or sign in.