1 00:00:00,540 --> 00:00:05,270 Hello and welcome to this lecture on air Jacks event. 2 00:00:05,520 --> 00:00:13,130 If you've done javascript or query before then you will know what events are. 3 00:00:13,380 --> 00:00:15,030 Events are easy. 4 00:00:15,050 --> 00:00:20,600 Visit us reaction or activities on a website. 5 00:00:20,610 --> 00:00:28,420 Events can include things like a mouse click a button click and a form submission. 6 00:00:29,250 --> 00:00:41,840 Ajax has an event called the on ready state change event when a request to this server is sent. 7 00:00:41,850 --> 00:00:52,350 We may want to perform certain actions based on the response from the server be on read this date change 8 00:00:52,350 --> 00:00:59,670 event triggers every time the release date changes. 9 00:00:59,790 --> 00:01:07,410 So did read this did property holds this date us off the exim Mail haste TTP requests. 10 00:01:07,680 --> 00:01:12,470 So there are three important properties of the exit mail. 11 00:01:12,630 --> 00:01:15,080 TTP request objects. 12 00:01:15,180 --> 00:01:18,480 So you've got the on ready state change. 13 00:01:18,750 --> 00:01:20,580 You've got it red state. 14 00:01:20,670 --> 00:01:31,390 And then you've got to state us so there are three properties or the three key properties of the SML 15 00:01:31,410 --> 00:01:38,430 Hayes TTP request object are the on ready stage Change event. 16 00:01:38,470 --> 00:01:49,200 They've got the red this date and then this date us be on red is date change event is used to store 17 00:01:49,400 --> 00:01:58,380 in store if function is stores a function or the name of a function to be called or vault automatically 18 00:01:58,390 --> 00:02:01,800 each time the read listed property changes. 19 00:02:01,980 --> 00:02:09,550 So if this date changes it triggers the function and it performs an action. 20 00:02:09,670 --> 00:02:21,140 The red state holds the status of the so mail his TTP request and the values ranges from zero to four. 21 00:02:21,480 --> 00:02:23,660 So when is set to zero. 22 00:02:23,680 --> 00:02:28,580 That means your request has not been immortalise yet. 23 00:02:29,190 --> 00:02:39,610 When is wrong one means this server has made a connection and it has been recognized when it's on. 24 00:02:39,620 --> 00:02:43,380 Three is process in the request. 25 00:02:43,380 --> 00:02:52,290 When this date when the release date is for the request has finished and the response is now ready then 26 00:02:52,290 --> 00:02:53,930 you look in the status. 27 00:02:53,940 --> 00:03:04,320 When this data is 200 That means it's okay but when it's 4 0 4 email the page can not be found. 28 00:03:04,680 --> 00:03:13,850 So when using be on read this date event you need to specify what state. 29 00:03:13,980 --> 00:03:16,810 If it's an error it read this date and also. 30 00:03:16,830 --> 00:03:18,790 If it's or k.. 31 00:03:19,020 --> 00:03:24,380 So you're specifying two things you're specifying the real estate. 32 00:03:24,390 --> 00:03:33,140 If the register is 4 and the existing does this 200 swear by you have read this for the status 200. 33 00:03:33,180 --> 00:03:35,560 That means the response is good to go. 34 00:03:36,700 --> 00:03:47,500 So the on ready state start already did change event this event here is Treat get. 35 00:03:47,530 --> 00:03:51,100 Every time the read this date changes. 36 00:03:51,310 --> 00:04:00,030 So disraeli's Stayed holds 5 values 0 to 4 0 1 2 3 4. 37 00:04:00,130 --> 00:04:02,910 So any time value changes. 38 00:04:03,190 --> 00:04:08,320 Be on the date event will perform a function. 39 00:04:08,470 --> 00:04:18,610 So this on this did change event has a function so that function is triggered every time the ready state 40 00:04:18,970 --> 00:04:19,790 changes. 41 00:04:19,960 --> 00:04:21,200 So this read this did. 42 00:04:21,220 --> 00:04:25,250 As for values from zero to four. 43 00:04:25,570 --> 00:04:35,160 So any time change is this unregistered Change event will trigger a function automatically. 44 00:04:35,260 --> 00:04:47,050 So in responding to this registry change thing you need to remember is that the this date holds 5 values 45 00:04:48,610 --> 00:04:51,700 of the state as these values represent this. 46 00:04:51,730 --> 00:04:53,800 Details of this here. 47 00:04:53,860 --> 00:04:59,470 T T P Es SML a dtp request object. 48 00:05:00,130 --> 00:05:07,440 So it determines what state this x x l s t t B request object is. 49 00:05:07,840 --> 00:05:11,860 So when they read this date is and 0. 50 00:05:12,190 --> 00:05:17,300 It means the request has not been initialized yet. 51 00:05:17,670 --> 00:05:18,120 See. 52 00:05:18,130 --> 00:05:28,360 So when the state is of them in the server has established a connection when the request he registered 53 00:05:28,360 --> 00:05:30,540 is to the request. 54 00:05:30,580 --> 00:05:33,500 That means your request has been received. 55 00:05:34,000 --> 00:05:41,120 When the red state is 3 that means the request is being processed. 56 00:05:41,470 --> 00:05:50,020 When they read this date it is for them is the request is finished and the response is ready all is 57 00:05:50,380 --> 00:05:56,060 done and then you look at the status statuses and read them. 58 00:05:56,130 --> 00:05:59,340 Is it's okay and it's good to go. 59 00:05:59,410 --> 00:06:05,390 If you have in this state or 4 0 reform mermin the page could not be found. 60 00:06:05,470 --> 00:06:14,350 So in the order of the already state change event you need to specify what will happen when the server 61 00:06:14,350 --> 00:06:17,270 response is ready to be processed. 62 00:06:17,290 --> 00:06:24,730 So for example you can see when the red state is 4 and the state is 208. 63 00:06:24,730 --> 00:06:26,710 The response is ready. 64 00:06:27,610 --> 00:06:30,220 Thank you so much for your time in this lecture. 65 00:06:30,220 --> 00:06:42,520 We looked had the horn ready state change event which is a Doubt's reef event and it has an radius date 66 00:06:42,640 --> 00:06:55,150 of 0 tool for an East date change triggers an action from the already state change event when this data 67 00:06:55,270 --> 00:06:58,070 is to uncorrect immense is good to go. 68 00:06:58,180 --> 00:06:59,840 Everything's okay. 69 00:07:00,310 --> 00:07:02,350 Thank you so much for your time. 70 00:07:02,350 --> 00:07:03,110 Bye for now.