1 00:00:08,930 --> 00:00:09,430 Hi. 2 00:00:09,430 --> 00:00:11,590 Today we're gonna talk about the very important, 3 00:00:11,590 --> 00:00:14,760 but often overlooked process of validating your site. 4 00:00:14,760 --> 00:00:17,090 What I mean by that is it's time for us to check your code. 5 00:00:18,430 --> 00:00:19,990 So why do we wanna validate? 6 00:00:21,260 --> 00:00:24,850 I like to call browsers the helicopter parents of programming. 7 00:00:24,850 --> 00:00:27,550 So a lot of times you're gonna be writing up your code and then you'll stop and 8 00:00:27,550 --> 00:00:28,700 you'll check and it looks great. 9 00:00:28,700 --> 00:00:30,950 And then you write some more code and you stop and you check. 10 00:00:30,950 --> 00:00:31,960 And it looks great. 11 00:00:31,960 --> 00:00:36,065 And by the sheer fact that it looks so good, you assume you must be right. 12 00:00:36,065 --> 00:00:39,345 But the p problem is, browsers are programmed to kind of look for 13 00:00:39,345 --> 00:00:41,115 your errors and fix them. 14 00:00:41,115 --> 00:00:45,725 The problem with this is that, not all browsers fix things the same way. 15 00:00:45,725 --> 00:00:48,785 It's also important to remember that not everyone is accessing your 16 00:00:48,785 --> 00:00:50,089 page with traditional browsers. 17 00:00:51,230 --> 00:00:55,320 So as your page becomes more complex, these little hidden problems, 18 00:00:55,320 --> 00:00:58,310 those little hidden errors that the browsers are hiding, can become 19 00:00:58,310 --> 00:01:01,540 devastating to people who are trying to access them with different software. 20 00:01:02,820 --> 00:01:06,430 So there are 3 approaches for validating your code for consistency. 21 00:01:06,430 --> 00:01:10,330 One is to validate what we call the URI or the URL. 22 00:01:10,330 --> 00:01:14,370 Another is to validate by your file name which means instead of giving you're URL 23 00:01:14,370 --> 00:01:16,660 you can actually upload your file to check it. 24 00:01:16,660 --> 00:01:19,820 The third way is what I called by Direct Input. 25 00:01:19,820 --> 00:01:22,360 So, let's go ahead and run through an example very quickly. 26 00:01:22,360 --> 00:01:24,530 In this side I'm gonna use is called the validator. 27 00:01:26,220 --> 00:01:27,510 All right. 28 00:01:27,510 --> 00:01:32,231 So, if you check here, we can start off by going to the validator.w3.org. 29 00:01:32,231 --> 00:01:35,990 As you can remember, the w3 is really the association for 30 00:01:35,990 --> 00:01:39,340 trying to make sure that everyone sticks to the same standards. 31 00:01:39,340 --> 00:01:41,040 And here are three options. 32 00:01:41,040 --> 00:01:44,770 We can validate by URI, the validate by file upload, and 33 00:01:44,770 --> 00:01:46,600 the validate by direct input. 34 00:01:46,600 --> 00:01:48,830 Now this is a somewhat important choice. 35 00:01:48,830 --> 00:01:52,390 Because for some of you, you may not decide to buy a hosting system, 36 00:01:52,390 --> 00:01:54,780 in which case you can not give it a URL. 37 00:01:54,780 --> 00:01:57,270 You can't type in C:// it 38 00:01:57,270 --> 00:02:01,920 just doesn't work when you put anything that's specific to your computer. 39 00:02:01,920 --> 00:02:05,490 So instead I'm going to show you an example of validate by direct input. 40 00:02:06,770 --> 00:02:09,910 So let's start by looking at the page we're gonna validate. 41 00:02:09,910 --> 00:02:14,840 Over here I have my little picture of Ashtabula with the beach. 42 00:02:14,840 --> 00:02:16,730 And as you can see, it looks pretty good, 43 00:02:16,730 --> 00:02:19,870 you don't see any problems with it as you kind of go back and forth. 44 00:02:19,870 --> 00:02:23,140 But let's see what happened when I actually grab all this code. 45 00:02:23,140 --> 00:02:25,820 So if you want this shortcut, this works for almost everyone. 46 00:02:25,820 --> 00:02:31,060 I'm gonna go ahead and do control-A and control-C. 47 00:02:31,060 --> 00:02:35,150 Head back over here and when I put it in and 48 00:02:35,150 --> 00:02:40,820 I click on check, once I start going down you can see this looks good. 49 00:02:40,820 --> 00:02:45,710 Right away it says you have an error and that error says stray end tag, and 50 00:02:45,710 --> 00:02:47,200 that's for a section. 51 00:02:47,200 --> 00:02:49,890 In most cases, the validators can kind of give you a clue 52 00:02:49,890 --> 00:02:54,060 as to which line you've messed up on, so let's go back and check the code. 53 00:02:54,060 --> 00:02:56,295 When I go over here and I go down to line 25. 54 00:02:56,295 --> 00:02:57,314 Oops. 55 00:02:57,314 --> 00:03:00,520 Go up a little bit here. 56 00:03:00,520 --> 00:03:03,400 Nope, still nothing there. 57 00:03:03,400 --> 00:03:04,350 Got really long lines. 58 00:03:04,350 --> 00:03:05,630 Oh, the validator's right. 59 00:03:05,630 --> 00:03:09,000 As you can see, I accidentally put section twice. 60 00:03:09,000 --> 00:03:13,670 What I really meant was to have an end section here and a beginning section here. 61 00:03:13,670 --> 00:03:14,840 So let's go ahead and get rid of that. 62 00:03:14,840 --> 00:03:22,080 I will save, I will grab it all again and let's try above putting in a new input. 63 00:03:25,540 --> 00:03:27,020 I'm actually gonna refresh. 64 00:03:27,020 --> 00:03:27,630 Go back here. 65 00:03:31,860 --> 00:03:33,310 And let's see if I have better luck this time. 66 00:03:36,760 --> 00:03:37,990 Good, good. 67 00:03:37,990 --> 00:03:40,260 No errors or warning to show, so I'm just going to go ahead and 68 00:03:40,260 --> 00:03:41,610 put my page back out there. 69 00:03:41,610 --> 00:03:44,000 So this is really just the simplest way to go in and 70 00:03:44,000 --> 00:03:46,840 make sure the syntax of your code is correct. 71 00:03:48,260 --> 00:03:52,460 Now, I kinda gave you a really simple example where I only had one error. 72 00:03:52,460 --> 00:03:55,520 What typically is going to happen is that it's gonna generate lots and 73 00:03:55,520 --> 00:03:56,650 lots of errors. 74 00:03:56,650 --> 00:03:59,320 And what I want to happen is make sure that you don't freak out when you see all 75 00:03:59,320 --> 00:04:00,220 of them. 76 00:04:00,220 --> 00:04:03,350 The reason is, is because error is what we call as propagate. 77 00:04:03,350 --> 00:04:04,630 The checker gets confused. 78 00:04:04,630 --> 00:04:07,980 When you see one error at the top, it kind of leads to a whole bunch of errors. 79 00:04:07,980 --> 00:04:08,620 So what you wanna do, 80 00:04:08,620 --> 00:04:12,180 is you always wanna fix the first error that the validator saw. 81 00:04:12,180 --> 00:04:14,980 Once you fix that, there's a really good chance 82 00:04:14,980 --> 00:04:18,460 that the 52 errors it detected have now dropped down to 12 or 11. 83 00:04:18,460 --> 00:04:22,280 Now, there's also the chance that once you fix one error, 84 00:04:22,280 --> 00:04:24,690 it's gonna be able to see that you had 20 or 30 more. 85 00:04:24,690 --> 00:04:27,550 But again, work on it step by step. 86 00:04:27,550 --> 00:04:30,710 If the error that the validator gives you isn't as clear as the one that I just saw, 87 00:04:30,710 --> 00:04:33,630 what you can do is search online and in the different forums. 88 00:04:33,630 --> 00:04:37,640 Because I can assure you that other people have seen the same errors before. 89 00:04:37,640 --> 00:04:42,960 So what you want to do right now, actually let's go back here, is let's go ahead and 90 00:04:42,960 --> 00:04:45,700 try validate file by URI. 91 00:04:45,700 --> 00:04:47,740 Pick your favorite site and go ahead and type it in. 92 00:04:47,740 --> 00:04:54,450 I'm going to go ahead and put in, not my own because I'm pretty sure it validates. 93 00:04:54,450 --> 00:04:57,420 I'm going to put in http://www.umsi.umich.edu, so 94 00:04:57,420 --> 00:05:02,310 my boss can get mad at me when I show his site potentially doesn't validate. 95 00:05:02,310 --> 00:05:06,300 Right away you can see that' it's going to find a lot of errors. 96 00:05:06,300 --> 00:05:09,890 No matter what site you put in, particularly if it's a very popular site, 97 00:05:09,890 --> 00:05:13,270 you're gonna see that there are a lot of errors in that big, 98 00:05:13,270 --> 00:05:14,600 the sites don't validate. 99 00:05:14,600 --> 00:05:17,440 Let's make sure your sites are better than theirs. 100 00:05:17,440 --> 00:05:20,500 So it's one thing to validate for what we call syntax. 101 00:05:20,500 --> 00:05:24,120 It's another question to validate for what we call accessibility. 102 00:05:24,120 --> 00:05:27,020 Again, we've talked about how important it is to make sure that 103 00:05:27,020 --> 00:05:30,040 your sites are accessible to the greatest number of people. 104 00:05:30,040 --> 00:05:34,860 So one of the places you can go to check that is wave.webaim.org, and 105 00:05:34,860 --> 00:05:37,700 it's a site for you to go and validate you accessibility. 106 00:05:37,700 --> 00:05:38,930 So let's take a look at that one again. 107 00:05:40,300 --> 00:05:44,420 I go up here, and I go to wave, got web accessibility. 108 00:05:44,420 --> 00:05:47,690 What you need to do here is, you can't upload your code by file, 109 00:05:47,690 --> 00:05:49,950 or just by the code itself, you need to put in a URL. 110 00:05:49,950 --> 00:05:54,813 So i'm gonna go ahead and go to that same one we did before which 111 00:05:54,813 --> 00:05:59,930 was the beaches. 112 00:05:59,930 --> 00:06:00,650 And put it in here. 113 00:06:03,230 --> 00:06:07,280 And you can see I didn't get any errors, but I did get a couple of alerts. 114 00:06:07,280 --> 00:06:09,200 And the alerts were simply telling me that. 115 00:06:09,200 --> 00:06:12,500 I'm not sure if your alternative text is quite as good as it should be. 116 00:06:12,500 --> 00:06:15,870 And also, another point is saying you have the same, a redundant link, 117 00:06:15,870 --> 00:06:17,600 which means you have the same link twice. 118 00:06:17,600 --> 00:06:20,830 So, right now everything looks good as far as syntax and 119 00:06:20,830 --> 00:06:24,040 the very high level of accessibility for the semantics. 120 00:06:25,050 --> 00:06:27,840 So, one of the nice things about the accessibility validation is that it 121 00:06:27,840 --> 00:06:31,320 gives you an idea of things that you haven't really thought about before but 122 00:06:31,320 --> 00:06:33,439 the downfall is that it only works on hosted pages. 123 00:06:34,700 --> 00:06:37,160 So validated sites are always more robust and 124 00:06:37,160 --> 00:06:39,820 more accessible than those sites that don't validate. 125 00:06:39,820 --> 00:06:42,930 So, as a coder it is your job to make sure that you go to these 126 00:06:42,930 --> 00:06:46,960 different validation sites and fix your code to be up to standards. 127 00:06:46,960 --> 00:06:50,400 If you're not coding it is also important for you to visit the sites 128 00:06:50,400 --> 00:06:53,560 that you go to on a regular basis and go ahead and validate those. 129 00:06:53,560 --> 00:06:56,960 Giving you a real sense of the different ways, people feel the importance or 130 00:06:56,960 --> 00:06:59,978 not importance of making their site accessible to everybody. 131 00:06:59,978 --> 00:07:02,789 Good luck.