Join Joseph LeBlanc for an in-depth discussion in this video Handling event types, part of Node.js First Look (2012).
Custom event types allow you to label events then handle each type differently.…Let's extend our browser side code to handle its specific events in…slightly different ways.…I've copied the chat_room folder from the exercise files.…Let's install the dependencies.…Now let's take a look at index.html.…We've changed long chat message to add another argument to the…function signature.…The new argument is called type.…
This allows us to have a different type of message displayed in the browser.…Currently, we'll define system and leave as two different message types.…For the system message type, we'll bold the text and for the leave message type…we'll bold the text and set the color to red.…In our event handlers, we're now going to pass that new argument…into log_chat_message.…When someone enters the room we want that to be a system event so that will get bolded.…
When someone leaves the chat room we want that to be a leave event so that will…get bolded and shown in red.…However, when someone's just chatting we want that to be normal.…
- Using the Socket.IO Node package to achieve "live" effects like Facebook notifications
- Scraping web sites using jQuery without a browser
Skill Level Beginner
Q: Does the instruction from "Selecting through browserless jQuery" work for Windows users?
A: The “Selecting through browserless jQuery” video does not work on Windows
XHTML and HTML Essential Trainingwith Bill Weinman4h 44m Beginner
1. Installing Node
2. Getting Started
Running a Node script2m 6s
4. Command Line Scripts
5. Creating Web Servers
7. WebSocket Programming
8. Connecting Beyond Node
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.