Start learning with our library of video tutorials taught by experts. Get started
Viewed by members. in countries. members currently watching.
In this course, part of his series of titles on HTML5 and CSS3, author and expert Andy Olsen looks at advanced topics like geolocation, mobile development, web sockets, Web SQL, and web workers. You'll also learn how to communicate between pages downloaded from different servers and how to use the new Ajax features in XMLHttpRequest Level 2. After completing this workshop, developers be well equipped to start utilizing the powerful features of HTML5.
Hello. My name's Andy Olson and welcome to the course. In this course, we're going to look at the variety of new HTML5 features that are very powerful, and allow you to create sophisticated web applications. I've got some examples that I'm going to go through in this lesson just to give you an idea of what to expect. I'm not going to go into the code in this lesson, because obviously we'll do that later. Also, I'm not going to attempt to give you a comprehensive insight into all the features, because obviously we'll be doing that later on, as well.
I just wanted here to give you a flavor of what to expect. So, we have examples on geoIocation. Wait and find out where you're located. Noble development. Websockets, which is a bit like client server communication between the browser and the server. WebSQL, which allows you to use SQL syntax to store data in the database in the browser. And web workers, which is multi-threading. Now some of these examples require you to run the application through a web server.
So what I've done on my machine is to copy all of these examples onto the Web Publisher folder for Microsoft IIS. So that's a folder called Inetpubwwroot. And you can see here, I've copied each of those folders into here. And I've run each of the examples through local host. So they've been served up through the web server. I've already opened the files in Chrome, other browsers would work as well, and I'll just lead you through these examples in this lesson.
So first up, we have a key location example for getting current position for HTML. This geolocation has an API, which allows you to find out where you are longitude and latitude. Either as a one off request, or as a continual request to tell me every time I move around geographically. This simple example, when I Click the button, makes a one off geolocation request, and it tells me my latitude, 51 degrees north of the equator, and my longitude, which is four degrees, west of Greenwich.
Code executes in a background thread. And when the code is finished, it sends me back a response, and in this simple example it's just an uppercase version of the text that I sent in. A web page can start any number of web workers. So if I Click the Start Worker Button several times. I now have several workers running in parallel. So you can achieve multi-threading, and you can keep the user interface responsive, while doing something in the background. You can also cancel a background worker if you want to, because the user might not want to complete an operation, for example.
Okay, next example is Web Sockets. Web Sockets support sophisticated communication between a web browser and a server. For example, a web browser can connect to a web server and send a message. And then the server can send back responses any time it wants to. The connection can remain open. To allow two way communication at any time between the browser and the server. So it's actually very sophisticated. Obviously, this requires a server. In the lesson where we look at this in detail, I'll explain how to set this up. But in brief, I'm using node JS as my web server.
And this is how you start in node JS to run my example server application. So when I do that, it starts listening on port 8888, as a random port number that I chose. If I got back into the browser and I just Press F5 to refresh the view, when the page loads, immediately it opens a web socket connection to the server. And the server knows how many clients it connected. So at the moment there's one client connected.
The client can send a message to the server at anytime. So for example, I can Type in Super Swans. And I Press Send to server and if I just scroll down a little. You can see that the server bounces the same message straight back to me. Like so. Also, we can have multiple clients talking to the same server. So, I'll just take the URL here and Open a new Tab and then Paste the URL in, Press Enter.
So now, there were two clients connected to the same server. If I close this window, it disconnects. Back in my original tab, if I scroll down a little, then it realizes now there's just one client connected again. There were two, but now there's just one. So that's Web Sockets. Next example is Mobile Application Development. There are several mobile HTML libraries that you can use.
In the lesson where we look at this in detail, I'm going to show you how to use jQuery mobile to create a web application like this that's designed to look good on a mobile device. So it's a list of training courses that you might want to attend. I can Click on a link to open up a new page. And it looked kind of good in a mobile device. I can go back. I can create a new course. Let's say we wanted to have a course on C++. That's going to be five days, and we're going to get certified after it.
And I'll Click Save. And there's the new item there. So, jQuery Mobile, great, we'll have a look at that later in the course. Last example I want to show you just now, is WebSQL. Web SQL allows you to use SQL syntax to store data in a database built into the browser. It's based on local storage, and the example I've got here allows me to enter courses and duration and store them in a database. So let's say we wanted to have a course on C++.
That was going to be five days Add Course. So it stores that in my Client Save Database. Let's say we also wanted to have a course on WPF. And let's say that course is going to be four days. Add Course. So we now have two rows. Select courses, tells me all the details. I can delete the course and I've just deleted the WPF course. That's no longer there.
So that's just a quick run through. The capabilities of HTML5 that we look at here in the course. Lots more details to come obviously, but it gives you an idea of where we're headed. We're going to have look at key location, multi-threading, Web sockets, mobile development, web SQL databases. And much more besides.
There are currently no FAQs about HTML5 Power Workshop.
Access exercise files from a button right under the course name.
Search within course videos and transcripts, and jump right to the results.
Remove icons showing you already watched videos if you want to start over.
Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.
Click on text in the transcript to jump to that spot in the video. As the video plays, the relevant spot in the transcript will be highlighted.