New Feature: Playlist Center! Pick a topic and let our playlists guide the way.

Easy-to-follow video tutorials help you learn software, creative, and business skills.Become a member

Setting the scene

From: HTML5 Power Workshop

Video: Setting the scene

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.

Setting the scene

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.

So, do you know where I am? I'm in Swansea. It also tells me a time stamp. So it's the 15th of March and summer is on the way. So that's an example of geolocation. Next example is Web workers. This is multi-threading, an HTML file can reference JavaScript files and run that code in a separate thread. So when I click this button, start Worker. It creates a web worker that sends a message.

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.

Show transcript

This video is part of

Image for HTML5 Power Workshop
HTML5 Power Workshop

22 video lessons · 3745 viewers

Andy Olsen
Author

 

Start learning today

Get unlimited access to all courses for just $25/month.

Become a member
Sometimes @lynda teaches me how to use a program and sometimes Lynda.com changes my life forever. @JosefShutter
@lynda lynda.com is an absolute life saver when it comes to learning todays software. Definitely recommend it! #higherlearning @Michael_Caraway
@lynda The best thing online! Your database of courses is great! To the mark and very helpful. Thanks! @ru22more
Got to create something yesterday I never thought I could do. #thanks @lynda @Ngventurella
I really do love @lynda as a learning platform. Never stop learning and developing, it’s probably our greatest gift as a species! @soundslikedavid
@lynda just subscribed to lynda.com all I can say its brilliant join now trust me @ButchSamurai
@lynda is an awesome resource. The membership is priceless if you take advantage of it. @diabetic_techie
One of the best decision I made this year. Buy a 1yr subscription to @lynda @cybercaptive
guys lynda.com (@lynda) is the best. So far I’ve learned Java, principles of OO programming, and now learning about MS project @lucasmitchell
Signed back up to @lynda dot com. I’ve missed it!! Proper geeking out right now! #timetolearn #geek @JayGodbold

Are you sure you want to delete this note?

No

Thanks for signing up.

We’ll send you a confirmation email shortly.


Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

Keep up with news, tips, and latest courses with emails from lynda.com.

Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

   
submit Lightbox submit clicked
Terms and conditions of use

We've updated our terms and conditions (now called terms of service).Go
Review and accept our updated terms of service.