├── README.md ├── UNIT 1 ├── Anchor code │ ├── 1.intro_form.html │ ├── 2.emailasformaction.html │ ├── 3.intro_boxmodel.html │ ├── 4.js_sort_random.html │ ├── 5.obj_intro.html │ ├── 6.obj_inheritance.html │ ├── 7.class.html │ ├── 8.call_apply_bind.html │ ├── U1L4.html │ └── U1L4_ip.html ├── Box_model.html ├── CSS_col_fonts.html ├── DESCENDANT_selectors.html ├── External_link.html ├── FunctionReturn.html ├── Function_Parameter.html ├── Function_arguments.html ├── HTML5_DOC_STRUCT.html ├── HTML_Lists.html ├── Hover_example.html ├── Image.html ├── Inheritance.html ├── Internalprac.html ├── JavaScript_Array.html ├── LET_ex.html ├── Prototypal.html ├── STYLE.CSS ├── Span.html ├── TAble_example.html ├── VistednHover.html ├── basicsjs.html ├── border.html ├── css.html ├── css_form.html ├── css_table.html ├── form_example.html ├── forms.html ├── global_var.html ├── hello.js ├── html5_color.html ├── html5_inputType.html ├── img_link.html ├── inlineprac.html ├── javascript_ex.html ├── javascript_operators.html ├── letnConst.html ├── local_var.html ├── prototype.html ├── pseudo_ex.html ├── screen IO.html ├── screen_output.html ├── table_border.html ├── table_colspan.html ├── table_rowspan.html ├── type_of ex1.html ├── varletconst.html └── varnlet.html ├── UNIT 2 ├── .vscode │ └── settings.json ├── ClearTimeout.html ├── Doc_structure.html ├── Document_method.html ├── Event_Bubbling.html ├── Event_Capturing.html ├── HTML5_Aud.html ├── HTML5_Video.html ├── HTML5_canvas_1.html ├── HTML5_contenteditable.htm ├── HTML5_email.htm ├── HTML5_ex.htm ├── ONMOUSEOVER.html ├── ONMOUSEOVER_OUT.html ├── Zomato_logo.png ├── ajaxex.html ├── callajax.html ├── canvas.htm ├── child.html ├── class_qs.html ├── clientX_Y.html ├── contextmenu_1.html ├── create_elem1.html ├── create_element.html ├── create_element_text.html ├── create_txtNode.html ├── customevent.html ├── dbclick.html ├── dom.html ├── dowork.js ├── elem_tag1.html ├── elment_classname.html ├── elment_id.html ├── elment_name.html ├── elment_tag.html ├── event_flow.html ├── event_hand.html ├── event_hand1.html ├── event_prop.html ├── form.html ├── from_to.html ├── geoloc.htm ├── get_attr.html ├── getajax.html ├── getjson.html ├── html5.htm ├── html5.zip ├── html5a.htm ├── html5b.htm ├── html5c.htm ├── html5d.htm ├── html5e.htm ├── html5f.htm ├── html5g.htm ├── html5h.htm ├── html5i.htm ├── html5j.htm ├── html5k.htm ├── inline_style.html ├── innerHTML.html ├── innerTxt.html ├── insert_Before.html ├── jq_aj_fetch.html ├── jyp_ON.html ├── jyp_animate.htm ├── jyp_animate1.htm ├── jyp_append.htm ├── jyp_appendto.html ├── jyp_before_after.htm ├── jyp_callback.html ├── jyp_chaining.html ├── jyp_chaining_1.html ├── jyp_change.html ├── jyp_classSel.html ├── jyp_click.html ├── jyp_css.htm ├── jyp_delay.html ├── jyp_double-click.html ├── jyp_element_class.html ├── jyp_element_sel.html ├── jyp_fadein.htm ├── jyp_fadeout.htm ├── jyp_fadeout_span.htm ├── jyp_filter.htm ├── jyp_filter_eq.htm ├── jyp_focus.html ├── jyp_form.html ├── jyp_getter.html ├── jyp_hide_show.html ├── jyp_hover.htm ├── jyp_load.html ├── jyp_mouse_enter_leave.html ├── jyp_mouseenter.html ├── jyp_mouseup.html ├── jyp_multiple.html ├── jyp_multiple_elememts.html ├── jyp_post.html ├── jyp_post1.html ├── jyp_setter.html ├── jyp_show.htm ├── jyp_show1.html ├── jyp_slideDown.html ├── jyp_slideUp.html ├── jyp_toogle.html ├── key_Uppercase.html ├── keycode.html ├── keycode1.html ├── load_xml2.html ├── logo.png ├── metakey.html ├── modifier .html ├── mouse.html ├── mouse_over.html ├── mouse_over_out (2).html ├── new3.xml ├── onclick.html ├── onclick_event_handler.html ├── onfocus.html ├── onfocus1.html ├── onload.html ├── onready.html ├── parent_node.html ├── pic1.jpg ├── pic2.jpg ├── postajax.html ├── querySel.html ├── querySel_1.html ├── querySel_2.html ├── querySel_All.html ├── querySel_All_1.html ├── query_both.html ├── remove_attr.html ├── remove_child.html ├── replace_child.html ├── sam.js ├── sam.json ├── sam.xml ├── sam1.json ├── screenX_Y.html ├── screen_coordinates.html ├── setInterval.html ├── set_attr.html ├── set_attr1.html ├── set_clearInterval.html ├── settimeout.html ├── shuttle.mp4 ├── siblings.html ├── svg.htm ├── test.php ├── travel.jpeg ├── travelwoman.jpg ├── web_workers.html ├── worker1.html ├── ww.htm ├── xmlparse.html └── xmlparse1.html ├── UNIT 3 ├── Anchor_code │ ├── U3L2.html │ ├── U3L3.html │ ├── U3L4.html │ ├── U3L5.html │ ├── U3L6.html │ ├── U3L6_1.html │ ├── U3L7.html │ ├── U3L8.html │ ├── images │ │ ├── peacock.jpg │ │ └── tiger.jpg │ ├── ref.html │ └── ref_pass.html ├── Counter_Events.html ├── Nested Components.html ├── React_styling.html ├── Refs1.html ├── Refs2.html ├── Refs3.html ├── Unit3_React.pdf ├── add_Image.html ├── basic_Component.html ├── basiccomponent.html ├── bindingevents.html ├── bloglayout.html ├── characterlog.html ├── clock.html ├── colours.html ├── compl_components.html ├── components.html ├── context_basic.html ├── controlled.html ├── counter.html ├── discount.html ├── eventobject.html ├── events_1.html ├── events_2.html ├── facebackCard.html ├── facebookcard.html ├── firstprgm.html ├── firstreact.html ├── firstreactcode.html ├── formvalidation.html ├── greet_event.html ├── idwithprops.html ├── image_react.html ├── issuetracker_1.html ├── issuetracker_2a.html ├── issuetracker_2b.html ├── issuetracker_3.html ├── issuetracker_4.html ├── keys.html ├── lifecycle.html ├── lifecycle1.html ├── lifecycleR1.html ├── map.html ├── map_key.html ├── mouse_events.html ├── mouseevents.html ├── multipleinputs.html ├── nested(q1).html ├── parameters.html ├── props.child.html ├── props.html ├── react_event.html ├── react_event2.html ├── react_form_val.html ├── react_forms1.html ├── react_forms3.html ├── react_styles.html ├── reactbasic.html ├── reactstyle.html ├── reactwithjsx.html ├── refs_1.html ├── refs_2.html ├── refs_3.html ├── simpleform.html ├── spread_operator.html ├── stateless.html ├── stateless_2.html ├── static_getDerivedStateFromProps().html ├── super_example.html ├── uncontrolled.html └── updatingcontext.html ├── UNIT 4 ├── AppendFile.js ├── Blocking.js ├── Collection_create.js ├── HTTP_Client.js ├── HTTP_Server.js ├── NonBlocking.js ├── Readstreams1.js ├── Unit4.docx ├── Unit4.pdf ├── Write_streams.js ├── buffer.js ├── calculator.js ├── chaining_stream.js ├── clearInterval.js ├── clearTimeout.js ├── createDB.js ├── delete.js ├── delete1.js ├── deleteMany.js ├── document_insert.js ├── document_insertMany.js ├── event.js ├── event1.js ├── event2.js ├── event2_addList.js ├── eventLoop_understanding.js ├── eventemitter.js ├── findall.js ├── httpHeader.js ├── httprequestclient.js ├── httprequestserver.js ├── moduleExample.js ├── openFile.js ├── pipe_stream.js ├── readFile.js ├── renameFile.js ├── setInterval.js ├── setTimeout.js ├── update.js └── writeFile.js └── UNIT 5 ├── AnchorCodes ├── FileUpload.txt ├── Form(pug).txt ├── Formdata.txt ├── Middleware-static.txt ├── cookie.js ├── err_handling.txt ├── exp.js ├── exp_mw.js ├── exp_req.js ├── hello.js ├── index.js └── student.js ├── Application_level_middleware.js ├── Router-level_middleware.js ├── Unit5.pdf ├── bodyparser.js ├── bodyparser1.js ├── cookie1.js ├── cookie11.js ├── cookie111.js ├── cookieparser.js ├── errorhandling.js ├── express_server.js ├── fileupload.js ├── form.html ├── form_1.html ├── formserver.js ├── formserver_1.js ├── index.js ├── middleware.js ├── middleware3.js ├── middleware_1.js ├── middleware_2.js ├── middlewareorder.js ├── middlewareorder_2.js ├── middlewareorder_3.js ├── requestlogging.js ├── routing.js ├── things.js ├── upload.html └── urlbuilding.js /README.md: -------------------------------------------------------------------------------- 1 | # WT-Programs -------------------------------------------------------------------------------- /UNIT 1/Anchor code/2.emailasformaction.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Title of the document 5 | 10 | 11 | 12 |

Give Feedback to Our Website.

13 |
14 |
15 | 18 |
19 |
20 | 23 |
24 |
25 | 26 |
27 | 28 |
29 |
30 | 31 | 32 |
33 |
34 | 35 | -------------------------------------------------------------------------------- /UNIT 1/Anchor code/4.js_sort_random.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | JavaScript 4 | 5 | 6 |

This is the javascript program on DOM Manipulation. 7 |

8 | 14 | 25 | 26 | -------------------------------------------------------------------------------- /UNIT 1/Anchor code/5.obj_intro.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /UNIT 1/Anchor code/7.class.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /UNIT 1/Anchor code/8.call_apply_bind.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 27 | 28 | -------------------------------------------------------------------------------- /UNIT 1/Anchor code/U1L4_ip.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | HTML5 tags 4 | 14 | 15 | 16 |
17 | 18 | 19 | 20 | 21 |
22 | 23 | -------------------------------------------------------------------------------- /UNIT 1/Box_model.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 20 | 21 | 22 |
Division 1
23 |
Division 2
24 | 25 | -------------------------------------------------------------------------------- /UNIT 1/CSS_col_fonts.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 12 | 13 | 14 | 15 |

Hello World

16 | 17 |

18 | Example for background color. 19 |

20 | 21 |

Example for Text color

22 |

Example for border

23 | 24 | -------------------------------------------------------------------------------- /UNIT 1/DESCENDANT_selectors.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Descendant 5 | 12 | 13 | 14 |
15 | Item1 16 | Item2 17 | Item3 18 | 23 |
24 | 25 | -------------------------------------------------------------------------------- /UNIT 1/External_link.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | first prgm 5 | 6 | 7 | 8 | 9 |

hello world

10 |

this is heading

11 | -------------------------------------------------------------------------------- /UNIT 1/FunctionReturn.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Function 4 | 5 | 6 | 17 | 18 | -------------------------------------------------------------------------------- /UNIT 1/Function_Parameter.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |

function parameters

4 | 10 | 11 | -------------------------------------------------------------------------------- /UNIT 1/Function_arguments.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |

Arguments

4 | 12 | 13 | -------------------------------------------------------------------------------- /UNIT 1/HTML5_DOC_STRUCT.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | ... 7 | 8 | 9 | 10 |
11 |

HTML5 Document Structure Example

12 |

This page should be tried in safari, chrome or Mozila.

13 |
14 | 15 | 22 | 23 |
24 |
25 |

Once article can have multiple sections

26 |
27 |
28 | 29 | 32 | 33 |
34 | Click To See 35 |

Hello

36 |
37 | 38 |

This text is marked 39 | 40 |

43 | 44 | 45 | -------------------------------------------------------------------------------- /UNIT 1/HTML_Lists.html: -------------------------------------------------------------------------------- 1 | 15 | 16 | 30 | 31 | 32 | 33 | 34 | 35 |

A Description List

36 | 37 |
38 |
Coffee
39 |
- black hot drink
40 |
Milk
41 |
- white cold drink
42 |
43 | 44 | 45 | -------------------------------------------------------------------------------- /UNIT 1/Hover_example.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | First Prgm 4 | 16 | 17 | 18 |
hi where are you 19 |

Im here!!!

20 |
21 | 22 | -------------------------------------------------------------------------------- /UNIT 1/Image.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 |

HTML Image

6 | its nature 7 | 8 | 9 | -------------------------------------------------------------------------------- /UNIT 1/Inheritance.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Inheritance 5 | 6 | 7 | 8 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /UNIT 1/Internalprac.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 14 | 15 | 16 | 17 |

This is a heading

18 |

This is a paragraph.

19 | 20 | 21 | -------------------------------------------------------------------------------- /UNIT 1/JavaScript_Array.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |

Demo: JavaScript Array

5 |

6 |

7 |

8 |

9 |

10 | 11 | 24 | 25 | -------------------------------------------------------------------------------- /UNIT 1/LET_ex.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /UNIT 1/Prototypal.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Prototypal 5 | 6 | 7 | 8 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /UNIT 1/STYLE.CSS: -------------------------------------------------------------------------------- 1 | body { 2 | background-color: lightblue; 3 | } 4 | 5 | h1 { 6 | color: navy; 7 | margin-left: 20px; 8 | } -------------------------------------------------------------------------------- /UNIT 1/Span.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Example for Span Tag 5 | 6 | 7 | 10 | 11 | 12 |

I like blue and red

13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /UNIT 1/TAble_example.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 |

Basic HTML Table

6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 |
Table_header1Table_header2Table_header3
Table_data1Table_data2Table_data3
Table_data1Table_data2Table_data3
Table_data1Table_data2Table_data3
29 | 30 | 31 | -------------------------------------------------------------------------------- /UNIT 1/VistednHover.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 29 | 30 | 31 |

Hello World!

32 |

click the link: Google Home page

33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /UNIT 1/basicsjs.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Creating Variables in JavaScript 5 | 6 | 7 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /UNIT 1/css.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | 12 | 13 |

Hello World!

14 |

CSS

15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /UNIT 1/css_table.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | CSS class 5 | 15 | 16 | 17 |

Hello World!

18 |

Welcome to CSS

19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 |
Emp details
EmpNameEmpSalEmpdesgn
Raj40000Manager
Sam10000Agent
Arun20000Agent
44 | 45 | -------------------------------------------------------------------------------- /UNIT 1/global_var.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |

JavaScript Global scope

5 | 6 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /UNIT 1/hello.js: -------------------------------------------------------------------------------- 1 | function sayHello(){ 2 | alert("hello"); 3 | } 4 | 5 | document.getElementById("myBtn").onclick=sayHello; 6 | 7 | -------------------------------------------------------------------------------- /UNIT 1/html5_color.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | HTML5 Color Input Type 5 | 11 | 12 | 13 |
14 | 15 | 16 | 17 |
18 | 19 | -------------------------------------------------------------------------------- /UNIT 1/html5_inputType.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | first prgm 5 | 6 | 13 | 14 | 15 |

Examples of input element in HTML5

16 | Date : 17 | 18 |
19 |
20 | Select Number : 22 | 23 |
24 |
25 | Select Range : 27 | 28 |
29 |
30 | Enter email : 31 | 32 |
33 |
34 | Enter URL : 35 | 36 | -------------------------------------------------------------------------------- /UNIT 1/img_link.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 |

Image as a Link

6 | 7 |

The image below is a link. Try to click on it.

8 | 9 | Image not  avaiable 10 | 11 | 12 | -------------------------------------------------------------------------------- /UNIT 1/inlineprac.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 |

This is a heading

6 |

This is a paragraph.

7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /UNIT 1/javascript_ex.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | JavaScript 5 | 6 | 7 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /UNIT 1/letnConst.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Declaring Variables with let and const Keywords in JavaScript 6 | 7 | 8 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /UNIT 1/local_var.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |

JavaScript Global scope

5 |

6 | 7 | 25 | 26 | 27 | 28 | function fun() 29 | { 30 | var temp ="temp is defined in function scope"; 31 | console.log(temp); 32 | } 33 | 34 | fun(); 35 | console.log(temp); 36 | 37 | if(true) 38 | { 39 | var v1 =10; 40 | let v2=20; 41 | console.log(v1); 42 | console.log(v2); 43 | } 44 | 45 | console.log(v1); 46 | console.log(v2); -------------------------------------------------------------------------------- /UNIT 1/prototype.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Objects 5 | 6 | 7 | 8 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /UNIT 1/pseudo_ex.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 26 | 27 | 28 | 29 |

A journey of thousand miles begins with a single step. 30 | Howsoever big a task is, it starts with a small step. 31 | Example: I’m feeling overwhelmed by the prospect of completing 4,000-word paper by next week, but I guess I’ll start by writing 500 words every day. After all, a journey of a thousand miles begins with a single step.

32 | 33 |

This is second Para for p tag.A journey of thousand miles begins with a single step. 34 | Howsoever big a task is, it starts with a small step. 35 | Example: I’m feeling overwhelmed by the prospect of completing 4,000-word paper by next week, but I guess I’ll start by writing 500 words every day. After all, a journey of a thousand miles begins with a single step.

36 | -------------------------------------------------------------------------------- /UNIT 1/screen IO.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /UNIT 1/screen_output.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Writing into the Browser's Console with JavaScript 6 | 7 | 8 | 18 | 19 |

Example for confirm,prompt and alert.

20 | 25 | 30 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /UNIT 1/table_border.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 13 | 14 | 15 | 16 |

Table With Border

17 | 18 |

Use the CSS border property to add a border to the table.

19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 |
FirstnameLastnameAge
ABCqaz50
wsxedc94
rfvtgb80
42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /UNIT 1/table_colspan.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 14 | 15 | 16 | 17 |

Cell that spans two columns

18 |

To make a cell span more than one column, use the colspan attribute.

19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 |
NameTelephone
Bill Gates5557785455577855
31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /UNIT 1/table_rowspan.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 14 | 15 | 16 | 17 |

Cell that spans two rows

18 |

To make a cell span more than one row, use the rowspan attribute.

19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 |
Name:Bill Gates
Telephone:55577854
55577855
33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /UNIT 1/varletconst.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Var N Let N const 6 | 7 | 8 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /UNIT 1/varnlet.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Var N Let 6 | 7 | 8 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /UNIT 2/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "liveServer.settings.port": 5501 3 | } -------------------------------------------------------------------------------- /UNIT 2/ClearTimeout.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 20 | 21 | -------------------------------------------------------------------------------- /UNIT 2/Doc_structure.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | My home page 5 | 6 | 7 |

My home page

8 |

Hello, I am Riya and this is my home page.

9 |

I also wrote a book! Read it here.

10 | 11 | 12 | -------------------------------------------------------------------------------- /UNIT 2/Document_method.html: -------------------------------------------------------------------------------- 1 | Examples For Document method 2 | 3 | 4 | Change the Background 5 | 6 | 7 | 13 |
14 | Type the Color Name:
15 | Click the Submit Button to change this Background color as your Color.
16 | 17 |
18 | 19 | 20 | -------------------------------------------------------------------------------- /UNIT 2/Event_Bubbling.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Event Bubbling 6 | 7 | 8 |
9 | 10 |
11 | 12 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /UNIT 2/Event_Capturing.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Event Capturing 6 | 7 | 8 |
9 | 10 |
11 | 12 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /UNIT 2/HTML5_Aud.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | HTML5 Page 5 | 6 | 7 | 8 | 9 |

My First HTML5 Audio page.

10 | 11 | 12 | 13 |
14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | -------------------------------------------------------------------------------- /UNIT 2/HTML5_Video.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Embedding a YouTube Video in an HTML Page 6 | 7 | 8 |

9 | Watch youtube video here: 10 | 11 | https://www.youtube.com/watch?v=hLrVV2-oJ9g 13 |

14 | 15 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /UNIT 2/HTML5_canvas_1.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /UNIT 2/HTML5_contenteditable.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | untitled 7 | 8 | 9 |

To-Do List

10 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /UNIT 2/HTML5_email.htm: -------------------------------------------------------------------------------- 1 | 2 |   3 | 4 | 5 |      6 | 7 |      8 | form 9 | 10 | 11 |      12 |
13 |                     14 |               15 |
16 | 17 | 18 | -------------------------------------------------------------------------------- /UNIT 2/ONMOUSEOVER.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | 12 |

The onmouseover Activity

13 |
18 | 19 | 20 | -------------------------------------------------------------------------------- /UNIT 2/ONMOUSEOVER_OUT.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | Move the mouse over me! 15 |
16 | 17 | -------------------------------------------------------------------------------- /UNIT 2/Zomato_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adithya-m08/WT-Programs/8f3e37a39ba2ed942fca1b2580f9980a2daf1a7c/UNIT 2/Zomato_logo.png -------------------------------------------------------------------------------- /UNIT 2/ajaxex.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 |
7 | 8 |
9 | 21 | 22 | -------------------------------------------------------------------------------- /UNIT 2/callajax.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 14 | 15 | 16 | 17 |

Contents displayed here

18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /UNIT 2/canvas.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 13 | 14 | -------------------------------------------------------------------------------- /UNIT 2/child.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Child_node 5 | 6 | 7 | 8 |
9 |

Today's articles

10 | 11 |
12 |

A chain is only as strong as its weakest link.

13 |
14 |

One weak part will render the whole weak..

15 |

No matter how confident the team is, it is as strong as its weakest link – its defence.

16 |
17 |
18 | 19 |
20 | 21 |

All good things come to an end

22 |
23 |

Good experiences eventually come to an end...

24 |
25 |
26 | 34 |
35 | 36 | -------------------------------------------------------------------------------- /UNIT 2/class_qs.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | JavaScript Select Elements with CSS Selectors 6 | 7 | 8 | 13 | 14 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /UNIT 2/clientX_Y.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |

client X&Y coordinates and the value

5 |

6 | 7 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /UNIT 2/contextmenu_1.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |

Context Menu example

4 | 5 | 6 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /UNIT 2/create_elem1.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Creating Elements 5 | 6 | 24 | 25 | 26 | 27 |

Hello Class!

28 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /UNIT 2/create_element.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | JavaScript Insert New Element into the DOM 6 | 7 | 8 |
9 |

Hello World!

10 |

This is a simple paragraph.

11 |
12 | 13 | 14 | 15 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /UNIT 2/create_element_text.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | DOM Manipulation 5 | 6 | 7 |

First Paragraph

8 | 10 | 11 | 24 | 25 | -------------------------------------------------------------------------------- /UNIT 2/create_txtNode.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | createTextNode() Method 5 | 16 | 17 | 18 |

Vacation

19 |

TextNode Method

20 | 21 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /UNIT 2/customevent.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | JavaScript Custom Event 7 | 8 | 9 |
JS Custom Event
10 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /UNIT 2/dbclick.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 |

Hello world :):)

7 |

Double Click Example.

8 |

This is an example of creating the double click event using the addEventListener() method .

9 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /UNIT 2/dom.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | DOM 4 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /UNIT 2/dowork.js: -------------------------------------------------------------------------------- 1 | self.addEventListener( 2 | "message", 3 | function (e) { 4 | self.postMessage(e.data); 5 | }, 6 | false 7 | ); 8 | -------------------------------------------------------------------------------- /UNIT 2/elem_tag1.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | JavaScript getElementsByTagName() Demo 5 | 6 | 7 |

JavaScript getElementsByTagName() Demo

8 |

First heading

9 |

This is the first paragraph.

10 |

Second heading

11 |

This is the second paragraph.

12 |

Third heading

13 |

This is the third paragraph.

14 | 15 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /UNIT 2/elment_classname.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 |

this is example for Classname

6 |

I like to travel

7 | 8 |

but solo travelling

9 |

10 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /UNIT 2/elment_id.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Element Accessing 5 | 6 | 7 | 13 |
14 | Enter No:

15 | 16 |
17 | 18 | 19 | -------------------------------------------------------------------------------- /UNIT 2/elment_name.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | My home page 5 | 10 | 15 | 16 | 17 | 18 |
19 |
20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /UNIT 2/elment_tag.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | My home page 5 | 6 | 7 | 8 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /UNIT 2/event_flow.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | JS Event Demo 5 | 6 | 7 |
8 | 9 |
10 | 11 | 12 | -------------------------------------------------------------------------------- /UNIT 2/event_hand.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Random color example — event handler attribute 6 | 11 | 12 | 13 | 14 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /UNIT 2/event_hand1.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Random color example — event handler attribute 6 | 11 | 12 | 13 | 14 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /UNIT 2/form.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | JavaScript Form Demo 5 | 6 | 7 | 8 | 9 |
10 |
11 |

Sign Up

12 |
13 | 14 | 15 | 16 |
17 |
18 | 19 | 20 | 21 |
22 |
23 | 24 |
25 |
26 |
27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /UNIT 2/from_to.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 22 | 23 | -------------------------------------------------------------------------------- /UNIT 2/geoloc.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | HTML5 Geo Location 5 | 6 | 7 | 8 | 32 | 33 | 2 | 3 | 4 | 5 | JavaScript Get the Value of an Attribute 6 | 7 | 8 |

Google

9 | 10 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /UNIT 2/getajax.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 9 | 22 | 23 | 24 |

jQuery get() method demo 25 |

26 | 27 |

28 |

29 | 30 | -------------------------------------------------------------------------------- /UNIT 2/getjson.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 16 | 17 | 18 | 19 | 20 |
21 | 22 | 23 | -------------------------------------------------------------------------------- /UNIT 2/html5.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 |

Welcome to HTML5

6 |
This is a header tag
7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /UNIT 2/html5.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adithya-m08/WT-Programs/8f3e37a39ba2ed942fca1b2580f9980a2daf1a7c/UNIT 2/html5.zip -------------------------------------------------------------------------------- /UNIT 2/html5a.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 |

Welcome to Techinfo

6 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /UNIT 2/html5b.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Article on Indian Startups 5 | 14 | 15 | 16 |
17 | zomato pic 18 |

Zomato

19 |

Deepindar Goyal and Gauvrav Gupta are the co founder of Zomato. 20 | Zomato recently made its journey to Indian Stock Exchange. 21 | Zomato has the Market cap of 1L cr which is one of the highest 22 | in indian start Ups 23 |

24 |

Gaurav Gupta

25 |

Gaurav Gupta is from IIT Delhi and also Did his PG in 26 | IIM Culcutta. 27 | Recendly Gurav Gupta Left Zomato on 13/09/2021 28 |

29 |
30 |

31 | 32 | 33 | 34 |
35 | 36 | -------------------------------------------------------------------------------- /UNIT 2/html5c.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 |

Demo for Output Tag

6 |
7 | + = 8 | 9 |
10 | 11 | 12 | -------------------------------------------------------------------------------- /UNIT 2/html5d.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 |

Detail tag

6 |
7 | About Bounce 8 |

9 | Bounce is and Indian Start Up. Founded in Karnataka, A young group from Karnataka, Hassan Malnad College 10 | Students Founded Bounce in 2008. 11 |

12 |
13 | 14 | 15 | -------------------------------------------------------------------------------- /UNIT 2/html5e.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /UNIT 2/html5f.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Fig Caption 5 | 6 | 7 |
8 | 9 |
Road Image
10 |
11 | 12 | 13 | -------------------------------------------------------------------------------- /UNIT 2/html5g.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 |

Progress

6 | 7 | 8 | 60% 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /UNIT 2/html5h.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 |

Before canvas

6 | 7 |

After Canvas

8 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /UNIT 2/html5i.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /UNIT 2/html5j.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Get My Location 5 | 6 | 7 | 8 |

9 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /UNIT 2/html5k.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | JS as Single Thread 5 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /UNIT 2/inline_style.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | JavaScript Add Inline Styles to an Element 6 | 7 | 8 |

This is a paragraph.

9 |

This is another paragraph.

10 | 11 | 12 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /UNIT 2/innerHTML.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |

Click me.

5 | 6 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /UNIT 2/innerTxt.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | DOM Manipulation 5 | 6 | 7 |

First Paragraph

8 | 9 | 16 | 17 | -------------------------------------------------------------------------------- /UNIT 2/insert_Before.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 8 | 9 |

Click the button to insert an item to the list.

10 | 11 | 12 | 13 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /UNIT 2/jq_aj_fetch.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Fetch 5 | 33 | 34 | 35 | 36 |
37 | 38 | 39 | -------------------------------------------------------------------------------- /UNIT 2/jyp_ON.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | DOM 4 | 5 | 12 | 17 | 18 | 19 |

on method is useful for binding the same handler function to multiple events

20 | 21 | 22 | -------------------------------------------------------------------------------- /UNIT 2/jyp_animate.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | animate demo 6 | 13 | 14 | 15 | 16 | 17 |
Hello!
18 | 19 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /UNIT 2/jyp_animate1.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | animate demo 6 | 16 | 17 | 18 | 19 |

20 |
21 |
22 |
23 |
24 |
25 |
26 | 27 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /UNIT 2/jyp_append.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Append 6 | 7 | 13 | 14 | 15 |

I like to reading...

16 |

But not everyday...

17 | 18 | 19 | -------------------------------------------------------------------------------- /UNIT 2/jyp_appendto.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 12 | 13 | 14 | 15 |

I am a new reader.

16 |

I am also a new reader.

17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /UNIT 2/jyp_before_after.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 10 | 21 | 22 | 23 | travelwoman

24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /UNIT 2/jyp_callback.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Example of jQuery Effect Method without Callback Function 6 | 7 | 14 | 22 | 23 | 24 |

This is paragraph.

25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /UNIT 2/jyp_chaining.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 12 | 13 | 14 |

jQuery chaning example

15 |

16 | This example is for chaning. This para will appear when you click on the Show Me! button with an increased 17 | font size. 18 |

19 | 20 | 21 | 22 | 23 | 26 | -------------------------------------------------------------------------------- /UNIT 2/jyp_chaining_1.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Example of jQuery Method Chaining 6 | 7 | 19 | 29 | 30 | 31 |

Hello World!

32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /UNIT 2/jyp_change.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 13 | 14 | 15 |
16 | 17 | 22 |
23 | 24 | 25 | -------------------------------------------------------------------------------- /UNIT 2/jyp_classSel.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 13 | 14 | 15 |

hello

16 |

Class

17 |

hi

18 | 19 | 20 | -------------------------------------------------------------------------------- /UNIT 2/jyp_click.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 12 | 19 | 20 | 21 |

Click on me and I'll disappear.

22 |

Click on me and I'll disappear.

23 |

Click on me and I'll disappear.

24 | 25 | -------------------------------------------------------------------------------- /UNIT 2/jyp_css.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 12 | 13 | 14 |

This is a heading

15 | 16 |

This is a paragraph.

17 |

This is a paragraph.

18 |

This is a paragraph.

19 | 20 |

This is a paragraph.

21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /UNIT 2/jyp_delay.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | delay demo 6 | 22 | 23 | 24 | 25 |

26 |
27 |
28 | 29 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /UNIT 2/jyp_double-click.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 12 | 13 | 14 |

If you double-click on me, I will disappear.

15 |

Click me away!

16 |

Click me too!

17 | 18 | 19 | -------------------------------------------------------------------------------- /UNIT 2/jyp_element_class.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 12 | 13 | 14 |

hello

15 |

Class

16 |

hi

17 |

what doing

18 | 19 | 20 | -------------------------------------------------------------------------------- /UNIT 2/jyp_element_sel.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 12 | 13 | 14 |

hello

15 |

Class

16 |

hi

17 | 18 | 19 | -------------------------------------------------------------------------------- /UNIT 2/jyp_fadein.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | fadeIn demo 6 | 28 | 29 | 30 | 31 | Click here... 32 |
33 |
34 |
35 | 36 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /UNIT 2/jyp_fadeout.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | fadeOut demo 6 | 12 | 13 | 14 | 15 |

If you click on this paragraph you'll see it just fade away.

16 | 17 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /UNIT 2/jyp_fadeout_span.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | fadeOut demo 6 | 18 | 19 | 20 | 21 |

22 | Find the modifiers - 23 |
24 |

25 |

26 | If you really want to go outside in the cold then make sure to wear your 27 | warm jacket given to you by your favorite teacher. 28 |

29 | 30 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /UNIT 2/jyp_filter.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | filter demo 6 | 15 | 16 | 17 | 18 |
19 |
20 |
21 |
22 |
23 |
24 | 25 | 31 | 32 | 35 | 36 | 37 | 38 | 44 | -------------------------------------------------------------------------------- /UNIT 2/jyp_filter_eq.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | eq demo 6 | 18 | 19 | 20 | 21 | 22 |
23 |
24 |
25 |
26 |
27 |
28 | 29 | 35 | 36 | 37 | 38 | 39 | 40 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /UNIT 2/jyp_focus.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 15 | 16 | 17 | Name:
18 | Email: 19 | 20 | 21 | -------------------------------------------------------------------------------- /UNIT 2/jyp_form.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 12 | 13 | 14 |
15 | Your Name:
16 | Your Age:

17 | 18 |
19 | 20 | 21 | -------------------------------------------------------------------------------- /UNIT 2/jyp_hide_show.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 15 | 16 | 17 |

jQuery show and hide example

18 |

Welcome to Class

19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /UNIT 2/jyp_hover.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 15 | 27 | 28 | 29 |

hover over me

30 | 31 | 32 | -------------------------------------------------------------------------------- /UNIT 2/jyp_load.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 12 | 13 | 14 | good morning 15 | 16 | 17 | -------------------------------------------------------------------------------- /UNIT 2/jyp_mouse_enter_leave.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 12 | 27 | 28 | 29 |

hi this is for mouseenter and mouseleave

30 | 31 | -------------------------------------------------------------------------------- /UNIT 2/jyp_mouseenter.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 12 | 13 | 14 |

Keep cursor over me

15 | 16 | 17 | -------------------------------------------------------------------------------- /UNIT 2/jyp_mouseup.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 13 | 14 | 15 |

example for mouse up

16 | 17 | 18 | -------------------------------------------------------------------------------- /UNIT 2/jyp_multiple.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 12 | 13 | 14 |

hello

15 |

Class

16 |

hi

17 | 18 | 19 | -------------------------------------------------------------------------------- /UNIT 2/jyp_multiple_elememts.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 12 | 13 | 14 |

hello

15 |

Class

16 |

hi

17 |

18 | This article is published on 19 | welcome to google 20 | website 21 |

22 |

what doing

23 | 24 | 25 | -------------------------------------------------------------------------------- /UNIT 2/jyp_post.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | jQuery.post demo 6 | 7 | 8 | 9 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /UNIT 2/jyp_post1.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | jQuery.post demo 6 | 7 | 8 | 9 |
10 | 11 | 12 |
13 | 14 |
15 | 16 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /UNIT 2/jyp_setter.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | jQuery Set Form Fields Values 6 | 7 | 15 | 16 | 17 | 18 | 19 | 20 |

Note: Click the above buttons to set the value of following input box.

21 |

22 | 23 |

24 | 25 | 26 | -------------------------------------------------------------------------------- /UNIT 2/jyp_show.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | show demo 6 | 11 | 12 | 13 | 14 | 15 |

Hello...

16 | 17 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /UNIT 2/jyp_show1.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | show demo 6 | 16 | 17 | 18 | 19 | 20 | 21 |
Hello ,
22 |
how
23 |
are
24 |
you?
25 | 26 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /UNIT 2/jyp_slideDown.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | slideDown demo 6 | 16 | 17 | 18 | 19 | Click me! 20 |
21 |
22 |
23 | 24 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /UNIT 2/jyp_slideUp.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | slideUp demo 6 | 11 | 12 | 13 | 14 |
15 | 16 | 17 |
18 | 19 |
20 | 21 | 22 |
23 | 24 |
25 | 26 | 27 |
28 | 29 |
30 | 31 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /UNIT 2/jyp_toogle.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | toggle demo 6 | 7 | 8 | 9 | 10 |

Hello

11 |

Good Bye

12 | 13 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /UNIT 2/key_Uppercase.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |

KeyUp Event

4 | 5 | 9 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /UNIT 2/keycode.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |

Keycode

4 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /UNIT 2/keycode1.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |

Keycode

4 |

5 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /UNIT 2/load_xml2.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | XmlHttpRequest 5 | 6 | 7 |

Display XML data in a table

8 | 9 |
10 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /UNIT 2/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adithya-m08/WT-Programs/8f3e37a39ba2ed942fca1b2580f9980a2daf1a7c/UNIT 2/logo.png -------------------------------------------------------------------------------- /UNIT 2/metakey.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |

Metakey Event

4 | 5 | 6 | 7 |

8 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /UNIT 2/modifier .html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 10 | -------------------------------------------------------------------------------- /UNIT 2/mouse.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |

The onmouseover Activity

5 | 6 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /UNIT 2/mouse_over.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |

mouseover Events

4 | 5 | 6 | 11 |

Keep cursor over me

12 | 13 | 14 | -------------------------------------------------------------------------------- /UNIT 2/mouse_over_out (2).html: -------------------------------------------------------------------------------- 1 | 2 | 3 | addEventListener! 4 | 5 | 21 | 22 | 23 |

addEventListener function

24 | unavailable
25 | 26 | 27 | 28 | 30 | -------------------------------------------------------------------------------- /UNIT 2/new3.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Xaiomi 5 | 11 Ultra 6 | 50000 7 | Android 10 8 | 9 | 10 | Apple 11 | 13 pro 12 | 90000 13 | IOS 14 | 15 | 16 | Samsung 17 | Galaxy 18 | 90000 19 | Ansroid 10 20 | 21 | -------------------------------------------------------------------------------- /UNIT 2/onclick.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Javascript Events 4 | 5 | 6 | 11 |
12 | 13 |
14 | 15 | 16 | -------------------------------------------------------------------------------- /UNIT 2/onclick_event_handler.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 10 | 11 |

Sample text

12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /UNIT 2/onfocus.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 10 | 11 | Enter your name:

12 | Enter your Age: 13 | 14 | 15 | -------------------------------------------------------------------------------- /UNIT 2/onfocus1.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | JavaScript Focus Events 5 | 6 | 7 |

Move focus to the password field to see the effect:

8 | 9 |
10 | 11 | 12 |
13 | 14 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /UNIT 2/onload.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 10 | 11 | 12 |

Example of the HTML onload attribute

13 |

HIIIII.

14 | 15 | 16 | -------------------------------------------------------------------------------- /UNIT 2/onready.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |

Using the XMLHttpRequest Object

5 | 6 |
7 | 8 |
9 | 10 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /UNIT 2/parent_node.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Parent_node 4 | 5 | 6 |
7 |

Today's articles

8 | 9 |
10 |

A chain is only as strong as its weakest link.

11 |
12 |

One weak part will render the whole weak..

13 |

No matter how confident the team is, it is as strong as its weakest link – its defence.

14 |
15 |
16 | 17 |
18 |

All good things come to an end

19 |
20 |

Good experiences eventually come to an end...

21 |
22 |
23 | 27 |
28 | 29 | 31 | -------------------------------------------------------------------------------- /UNIT 2/pic1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adithya-m08/WT-Programs/8f3e37a39ba2ed942fca1b2580f9980a2daf1a7c/UNIT 2/pic1.jpg -------------------------------------------------------------------------------- /UNIT 2/pic2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adithya-m08/WT-Programs/8f3e37a39ba2ed942fca1b2580f9980a2daf1a7c/UNIT 2/pic2.jpg -------------------------------------------------------------------------------- /UNIT 2/postajax.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 10 | 30 | 31 | 32 |

jQuery post() method demo

33 | 34 |

35 | 36 | 37 | -------------------------------------------------------------------------------- /UNIT 2/querySel.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |

This is a p element.

5 | 6 |

This is also a p element.

7 | 8 |

Click the button to add a background color to the first p element in the document.

9 | 10 | 11 | 12 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /UNIT 2/querySel_1.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |

A h3 element

5 |

A h2 element

6 | 7 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /UNIT 2/querySel_2.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | DOM Manipulation 5 | 6 | 7 |

First Paragraph

8 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /UNIT 2/querySel_All.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |

This example heading

5 |

A example paragraph

6 | 7 |

Click the button to add a background color all elements with class="example".

8 | 9 | 10 | 11 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /UNIT 2/querySel_All_1.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |

This is a p element.

5 | 6 |

This is also a p element.

7 | 8 |

Click the button to add a background color to the first p element (index 0) in the document.

9 | 10 | 11 | 12 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /UNIT 2/query_both.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | DOM Manipulation 5 | 6 | 7 |

First Paragraph

8 | 9 | Welcome to Google 10 | 11 | 12 | 13 | 14 | 23 | 24 | -------------------------------------------------------------------------------- /UNIT 2/remove_attr.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | JavaScript Remove an Attribute from an Element 6 | 7 | 8 | Google 9 | 10 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /UNIT 2/remove_child.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | JavaScript Remove an Element from the DOM 6 | 7 | 8 |
9 |

Hello World!

10 |

This is a simple paragraph.

11 |
12 | 13 | 14 | 15 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /UNIT 2/replace_child.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | JavaScript Replace an Element with another Element in the DOM 6 | 7 | 8 |
9 |

Hello World!

10 |

This is a simple paragraph.

11 |
12 | 13 | 14 | 15 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /UNIT 2/sam.js: -------------------------------------------------------------------------------- 1 | var j = 0; 2 | for (var i = 1; i < 1000000; i++) { 3 | j = i; 4 | } 5 | postMessage(j); 6 | -------------------------------------------------------------------------------- /UNIT 2/sam.json: -------------------------------------------------------------------------------- 1 | { 2 | "CATALOG": { 3 | "CD": [ 4 | { 5 | "TITLE": "Empire Burlesque", 6 | "ARTIST": "Bob Dylan", 7 | "COUNTRY": "USA", 8 | "COMPANY": "Columbia", 9 | "PRICE": "10.90", 10 | "YEAR": "1985" 11 | }, 12 | { 13 | "TITLE": "Hide your heart", 14 | "ARTIST": "Bonnie Tyler", 15 | "COUNTRY": "UK", 16 | "COMPANY": "CBS Records", 17 | "PRICE": "9.90", 18 | "YEAR": "1988" 19 | } 20 | ] 21 | } 22 | } -------------------------------------------------------------------------------- /UNIT 2/sam.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Empire Burlesque 5 | Bob Dylan 6 | USA 7 | Columbia 8 | 10.90 9 | 1985 10 | 11 | 12 | Hide your heart 13 | Bonnie Tyler 14 | UK 15 | CBS Records 16 | 9.90 17 | 1988 18 | 19 | -------------------------------------------------------------------------------- /UNIT 2/sam1.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Johnny", 3 | "age": 25 4 | } -------------------------------------------------------------------------------- /UNIT 2/screenX_Y.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |

Screen coordinates and the value.

5 |

6 | 7 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /UNIT 2/screen_coordinates.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | JS Mouse Location Demo 5 | 12 | 13 | 14 |

Move your mouse to see its location.

15 |
16 |

17 | 18 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /UNIT 2/setInterval.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |

Example for setInterval

5 |

6 | 7 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /UNIT 2/set_attr.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | JavaScript Set an Attribute on an Element 6 | 7 | 8 | 9 | 10 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /UNIT 2/set_attr1.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | JavaScript Change the Value of an Attribute 6 | 7 | 8 |

google

9 | 10 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /UNIT 2/set_clearInterval.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |

Example for setInterval() and clearInterval().

5 | 6 | 7 | 8 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /UNIT 2/settimeout.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 22 | 23 | -------------------------------------------------------------------------------- /UNIT 2/shuttle.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adithya-m08/WT-Programs/8f3e37a39ba2ed942fca1b2580f9980a2daf1a7c/UNIT 2/shuttle.mp4 -------------------------------------------------------------------------------- /UNIT 2/siblings.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Sibling 4 | 5 | 6 |
7 |

Today's articles

8 | 9 |
10 |

A chain is only as strong as its weakest link.

11 |
12 |

One weak part will render the whole weak..

13 |

No matter how confident the team is, it is as strong as its weakest link – its defence.

14 |
15 |
16 | 17 |
18 |

it says

19 |

All good things come to an end

20 |
21 |

Good experiences eventually come to an end...

22 |
23 |
24 | 33 |
34 | 35 | 37 | 39 | -------------------------------------------------------------------------------- /UNIT 2/svg.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Example of HTML svg Tag 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /UNIT 2/test.php: -------------------------------------------------------------------------------- 1 | "John","time"=>"2pm")); 3 | ?> -------------------------------------------------------------------------------- /UNIT 2/travel.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adithya-m08/WT-Programs/8f3e37a39ba2ed942fca1b2580f9980a2daf1a7c/UNIT 2/travel.jpeg -------------------------------------------------------------------------------- /UNIT 2/travelwoman.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adithya-m08/WT-Programs/8f3e37a39ba2ed942fca1b2580f9980a2daf1a7c/UNIT 2/travelwoman.jpg -------------------------------------------------------------------------------- /UNIT 2/web_workers.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Web Worker Demo 5 | 6 | 7 |

Validating the browser compatibility of Web Browsers

8 |
9 |
10 | 11 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /UNIT 2/worker1.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | JS as Single Thread 5 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /UNIT 2/ww.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Web worker 5 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /UNIT 2/xmlparse.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |

Using the XMLHttpRequest Object

5 | 6 |
7 | 8 |
9 | 10 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /UNIT 2/xmlparse1.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |

5 | 6 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /UNIT 3/Anchor_code/U3L2.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | React 4 | 5 | 6 | 7 | 8 | 9 |
10 | 18 | 19 | -------------------------------------------------------------------------------- /UNIT 3/Anchor_code/U3L3.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | React 4 | 5 | 6 | 7 | 8 | 9 |
10 | 33 | 34 | -------------------------------------------------------------------------------- /UNIT 3/Anchor_code/U3L4.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | React 4 | 5 | 6 | 7 | 8 | 9 |
10 | 40 | 41 | -------------------------------------------------------------------------------- /UNIT 3/Anchor_code/U3L7.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | React 4 | 5 | 6 | 7 | 8 | 9 |
10 | 19 | 20 | -------------------------------------------------------------------------------- /UNIT 3/Anchor_code/U3L8.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | React 4 | 5 | 6 | 7 | 8 | 9 |
10 | 27 | 28 | -------------------------------------------------------------------------------- /UNIT 3/Anchor_code/images/peacock.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adithya-m08/WT-Programs/8f3e37a39ba2ed942fca1b2580f9980a2daf1a7c/UNIT 3/Anchor_code/images/peacock.jpg -------------------------------------------------------------------------------- /UNIT 3/Anchor_code/images/tiger.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adithya-m08/WT-Programs/8f3e37a39ba2ed942fca1b2580f9980a2daf1a7c/UNIT 3/Anchor_code/images/tiger.jpg -------------------------------------------------------------------------------- /UNIT 3/Anchor_code/ref_pass.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | React 4 | 5 | 6 | 7 | 9 | 10 | 11 |
12 | 41 | 42 | -------------------------------------------------------------------------------- /UNIT 3/Unit3_React.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adithya-m08/WT-Programs/8f3e37a39ba2ed942fca1b2580f9980a2daf1a7c/UNIT 3/Unit3_React.pdf -------------------------------------------------------------------------------- /UNIT 3/add_Image.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 | 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /UNIT 3/basic_Component.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | React Components 5 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /UNIT 3/basiccomponent.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | React Components 5 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /UNIT 3/clock.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Clock 6 | 7 | 8 | 9 | 10 | 11 |
12 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /UNIT 3/components.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | React Components 5 | 6 | 7 | 8 | 9 | 10 | 11 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /UNIT 3/counter.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Counter 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /UNIT 3/firstprgm.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | React! 7 | 8 | 9 | 10 | 21 | 22 | 23 | 24 |
25 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /UNIT 3/firstreact.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | My first react code 5 | 6 | 7 | 8 | 9 |
10 | 14 | 15 | -------------------------------------------------------------------------------- /UNIT 3/firstreactcode.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | My first react code 5 | 6 | 7 | 8 | 9 |
10 | 14 | 15 | -------------------------------------------------------------------------------- /UNIT 3/image_react.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /UNIT 3/map_key.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /UNIT 3/props.child.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | React 7 | 8 | 9 | 10 | 21 | 22 | 23 | 24 |
25 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /UNIT 3/props.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | React Components 6 | 7 | 8 | 9 | 10 | 11 |
12 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /UNIT 3/react_event.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /UNIT 3/react_event2.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /UNIT 3/react_styles.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 9 | 10 | 11 | 22 | 23 | 24 | 25 |
26 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /UNIT 3/reactbasic.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | React! React! React! 7 | 8 | 9 | 10 | 11 | 22 | 23 | 24 | 25 |
26 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /UNIT 3/reactwithjsx.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | React with JSX 5 | 6 | 7 | 8 | 9 | 10 |
11 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /UNIT 3/stateless.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /UNIT 3/stateless_2.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /UNIT 3/super_example.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | React! 7 | 8 | 9 | 10 | 17 | 18 | 19 | 20 |
21 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | -------------------------------------------------------------------------------- /UNIT 4/AppendFile.js: -------------------------------------------------------------------------------- 1 | var fs = require('fs'); 2 | 3 | fs.appendFile('test.txt', 'Hello Class!', function (err) { 4 | if (err) 5 | console.log(err); 6 | else 7 | console.log('Append operation complete.'); 8 | }); -------------------------------------------------------------------------------- /UNIT 4/Blocking.js: -------------------------------------------------------------------------------- 1 | var fs = require("fs"); 2 | var data = fs.readFileSync('input.txt'); 3 | 4 | console.log(data.toString()); 5 | console.log("Program Ended"); -------------------------------------------------------------------------------- /UNIT 4/Collection_create.js: -------------------------------------------------------------------------------- 1 | var MongoClient = require('mongodb').MongoClient; 2 | var url = "mongodb://localhost:27017/"; 3 | MongoClient.connect(url, function(err, db) { 4 | if (err) throw err; 5 | var dbo = db.db("3k"); 6 | dbo.createCollection("customers", function(err, res) { 7 | if (err) throw err; 8 | console.log("Collection created!"); 9 | db.close(); 10 | }); 11 | }); 12 | -------------------------------------------------------------------------------- /UNIT 4/HTTP_Client.js: -------------------------------------------------------------------------------- 1 | var http = require('http'); 2 | var fetch = require('node-fetch'); 3 | 4 | 5 | fetch('http://localhost:8081/sam.json', { 6 | method: 'GET', 7 | headers: { 'Content-Type': 'application/json' }, 8 | }) 9 | .then(res => res.json()) 10 | .then(res => console.log(res)); -------------------------------------------------------------------------------- /UNIT 4/NonBlocking.js: -------------------------------------------------------------------------------- 1 | var fs = require("fs"); 2 | 3 | fs.readFile('input.txt', function (err, data) { 4 | if (err) return console.error(err); 5 | console.log(data.toString()); 6 | }); 7 | 8 | console.log("Program Ended"); -------------------------------------------------------------------------------- /UNIT 4/Readstreams1.js: -------------------------------------------------------------------------------- 1 | const fileSystem = require("fs"); 2 | var data = ""; 3 | 4 | const readStream = fileSystem.createReadStream("input.txt"); 5 | 6 | readStream.setEncoding("UTF8"); 7 | 8 | readStream.on("data", (chunk) => { 9 | data += chunk; 10 | }); 11 | 12 | readStream.on("end", () => { 13 | console.log(data); 14 | }); 15 | 16 | readStream.on("error", (error) => { 17 | console.log(error.stack); 18 | }); -------------------------------------------------------------------------------- /UNIT 4/Unit4.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adithya-m08/WT-Programs/8f3e37a39ba2ed942fca1b2580f9980a2daf1a7c/UNIT 4/Unit4.docx -------------------------------------------------------------------------------- /UNIT 4/Unit4.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adithya-m08/WT-Programs/8f3e37a39ba2ed942fca1b2580f9980a2daf1a7c/UNIT 4/Unit4.pdf -------------------------------------------------------------------------------- /UNIT 4/Write_streams.js: -------------------------------------------------------------------------------- 1 | var fs = require('fs'); 2 | var readableStream = fs.createReadStream('file1.txt'); 3 | var writableStream = fs.createWriteStream('file2.txt'); 4 | 5 | readableStream.setEncoding('utf8'); 6 | 7 | readableStream.on('data', function(chunk) { 8 | writableStream.write(chunk); 9 | }); -------------------------------------------------------------------------------- /UNIT 4/buffer.js: -------------------------------------------------------------------------------- 1 | // var buf = Buffer.alloc(15); 2 | // const buf1 = Buffer.allocUnsafe(10); 3 | // const buf1 = Buffer.allocUnsafe(10, 3); 4 | // console.log(buf1); 5 | 6 | // const buf1 = Buffer.allocUnsafe(100); 7 | // const len = buf1.write('welcomeuser',2,5,'utf8'); 8 | // console.log(len); 9 | 10 | // const buf = Buffer.from('welcome to node.js class'); 11 | // var len = buf.length 12 | // console.log(len) 13 | 14 | // array-to-buffer.js 15 | 16 | // var arr = [true, true, false]; 17 | // const buf = Buffer.from(arr); 18 | 19 | // for(const byt of buf.values()){ 20 | // console.log(byt); 21 | // } 22 | 23 | // // convert-json-to-buffer.js 24 | 25 | // const msg = '{"name":"John", "age":"22"}'; 26 | // var jsonObj = JSON.parse(msg); 27 | 28 | // // convert JSON object to String 29 | // var jsonStr = JSON.stringify(jsonObj); 30 | 31 | // // read json string to Buffer 32 | // const buf = Buffer.from(jsonStr); 33 | 34 | // console.log(buf.length); 35 | 36 | buf = new Buffer.alloc(26); 37 | for (var i = 0 ; i < 26 ; i++) { 38 | buf[i] = i + 97; 39 | } 40 | 41 | console.log( buf.toString('ascii')); // outputs: abcdefghijklmnopqrstuvwxyz 42 | console.log( buf.toString('ascii',0,5)); // outputs: abcde 43 | console.log( buf.toString('utf8',0,5)); // outputs: abcde 44 | console.log( buf.toString(undefined,0,5)); -------------------------------------------------------------------------------- /UNIT 4/calculator.js: -------------------------------------------------------------------------------- 1 | // Returns addition of two numbers 2 | exports.add = function (a, b) { 3 | return a+b; 4 | }; 5 | 6 | // Returns difference of two numbers 7 | exports.subtract = function (a, b) { 8 | return a-b; 9 | }; 10 | 11 | // Returns product of two numbers 12 | exports.multiply = function (a, b) { 13 | return a*b; 14 | }; -------------------------------------------------------------------------------- /UNIT 4/chaining_stream.js: -------------------------------------------------------------------------------- 1 | var fs = require('fs'); 2 | var zlib = require('zlib'); 3 | 4 | fs.createReadStream('input.txt') 5 | .pipe(zlib.createGunzip()) 6 | .pipe(fs.createWriteStream('output.txt')); -------------------------------------------------------------------------------- /UNIT 4/clearInterval.js: -------------------------------------------------------------------------------- 1 | function welcome () { 2 | console.log("Welcome Class!"); 3 | } 4 | var id1 = setTimeout(welcome,1000); 5 | var id2 = setInterval(welcome,1000); 6 | 7 | // clearInterval(id2); -------------------------------------------------------------------------------- /UNIT 4/clearTimeout.js: -------------------------------------------------------------------------------- 1 | function welcome () { 2 | console.log("Welcome Class!"); 3 | } 4 | var id1 = setTimeout(welcome,1000); 5 | var id2 = setInterval(welcome,1000); 6 | clearTimeout(id1); 7 | 8 | // Its recursive in nature. 9 | // It will terminate after one step if you use ClearInterval. 10 | 11 | // clearImmediate(immediateObject): 12 | // It is used to stop an immediateObject, as created by setImmediate 13 | // clearInterval(intervalObject): 14 | // It is used to stop an intervalObject, as created by setInterval 15 | // clearTimeout(timeoutObject): 16 | // It prevents a timeoutObject, as created by setTimeout -------------------------------------------------------------------------------- /UNIT 4/createDB.js: -------------------------------------------------------------------------------- 1 | var mongoclient=require('mongodb').MongoClient; 2 | var url="mongodb://localhost:27017/3k"; 3 | mongoclient.connect(url,function(err,db){ 4 | if(err)throw err; 5 | console.log("DB has been created and switched to db"); 6 | db.close(); 7 | }) -------------------------------------------------------------------------------- /UNIT 4/delete.js: -------------------------------------------------------------------------------- 1 | var fs = require('fs'); 2 | 3 | fs.unlink('test.txt', function () { 4 | 5 | console.log('write operation complete.'); 6 | 7 | }); -------------------------------------------------------------------------------- /UNIT 4/delete1.js: -------------------------------------------------------------------------------- 1 | var MongoClient = require('mongodb').MongoClient; 2 | var url = "mongodb://localhost:27017/"; 3 | MongoClient.connect(url, function(err, db) { 4 | if (err) throw err; 5 | var dbo = db.db("3k"); 6 | var myquery = { address: 'Mountain 21' }; 7 | dbo.collection("customers").deleteOne(myquery, function(err, obj) { 8 | if (err) throw err; 9 | console.log("1 document deleted"); 10 | db.close(); 11 | }); 12 | }); 13 | -------------------------------------------------------------------------------- /UNIT 4/deleteMany.js: -------------------------------------------------------------------------------- 1 | var url = "mongodb://localhost:27017/"; 2 | MongoClient.connect(url, function(err, db) { 3 | if (err) throw err; 4 | var dbo = db.db("3k"); 5 | var myquery = { address: "Highway 37" }; // address starts with O 6 | dbo.collection("customers").deleteMany(myquery, function(err, obj) { 7 | if (err) throw err; 8 | console.log(obj.deletedCount+ " document(s) deleted"); 9 | db.close(); 10 | }); 11 | }); 12 | -------------------------------------------------------------------------------- /UNIT 4/document_insert.js: -------------------------------------------------------------------------------- 1 | var MongoClient = require('mongodb').MongoClient; 2 | var url = "mongodb://localhost:27017/"; 3 | MongoClient.connect(url, function(err, db) { 4 | if (err) throw err; 5 | var dbo = db.db("3k"); 6 | var myobj = { name: "Company Inc", address: "Highway 37" }; 7 | dbo.collection("customers").insertOne(myobj, function(err, 8 | res) { 9 | if (err) throw err; 10 | console.log("1 document inserted"); 11 | db.close(); 12 | }); 13 | }); 14 | -------------------------------------------------------------------------------- /UNIT 4/document_insertMany.js: -------------------------------------------------------------------------------- 1 | var MongoClient = require('mongodb').MongoClient; 2 | var url = "mongodb://localhost:27017/"; 3 | MongoClient.connect(url, function(err, db) { 4 | if (err) throw err; 5 | var dbo = db.db("3k"); 6 | var myobj = [ 7 | { name: 'John', address: 'Highway 71'}, 8 | { name: 'Peter', address: 'Lowstreet 4'}, 9 | { name: 'Amy', address: 'Apple st 652'}, 10 | { name: 'Hannah', address: 'Mountain 21'}] 11 | dbo.collection("customers").insertMany(myobj, function(err, res) { 12 | if (err) throw err; 13 | console.log("Number of documents inserted: " + res.insertedCount); 14 | db.close(); 15 | }); 16 | }); 17 | -------------------------------------------------------------------------------- /UNIT 4/event.js: -------------------------------------------------------------------------------- 1 | // Import events module 2 | var events = require('events'); 3 | 4 | // Create an eventEmitter object 5 | var eventEmitter = new events.EventEmitter(); 6 | 7 | // Create an event handler as follows 8 | var connectHandler = function connected() { 9 | console.log('connection succesful.'); 10 | 11 | // Fire the data_received event 12 | eventEmitter.emit('data_received'); 13 | } 14 | 15 | // Bind the connection event with the handler 16 | eventEmitter.on('connection', connectHandler); 17 | 18 | // Bind the data_received event with the anonymous function 19 | eventEmitter.on('data_received', function(){ 20 | console.log('data received succesfully.'); 21 | }); 22 | 23 | // Fire the connection event 24 | eventEmitter.emit('connection'); 25 | 26 | console.log("Program Ended."); -------------------------------------------------------------------------------- /UNIT 4/event1.js: -------------------------------------------------------------------------------- 1 | var emitter = require('events').EventEmitter; 2 | function iterateProcessor(num) { 3 | var emt = new emitter(); 4 | setTimeout(function () { 5 | for (var i = 1; i <= num; i++) { 6 | emt.emit('BeforeProcess', i); 7 | console.log('Processing Iteration:' + i); 8 | emt.emit('AfterProcess', i); 9 | } 10 | } 11 | , 5000) 12 | return emt; 13 | } 14 | var it = iterateProcessor(5); 15 | 16 | it.on('BeforeProcess', function (info) { 17 | console.log('Starting the process for ' + info); 18 | }); 19 | 20 | it.on('AfterProcess', function (info) { 21 | console.log('Finishing processing for ' + info); 22 | }); -------------------------------------------------------------------------------- /UNIT 4/event2.js: -------------------------------------------------------------------------------- 1 | // get the reference of EventEmitter class of events module 2 | var events = require('events'); 3 | 4 | //create an object of EventEmitter class by using above reference 5 | var em = new events.EventEmitter(); 6 | 7 | //Subscribe for FirstEvent 8 | em.on('FirstEvent', function (data) { 9 | console.log('First subscriber: ' + data);}); 10 | 11 | // Raising FirstEvent 12 | em.emit('FirstEvent', 'This is my first Node.js event emitter example.'); 13 | -------------------------------------------------------------------------------- /UNIT 4/event2_addList.js: -------------------------------------------------------------------------------- 1 | var emitter = require('events').EventEmitter; 2 | 3 | var em = new emitter(); 4 | 5 | //Subscribe FirstEvent 6 | em.addListener('FirstEvent', function (data) { 7 | console.log('First subscriber: ' + data); 8 | }); 9 | 10 | //Subscribe SecondEvent 11 | em.on('SecondEvent', function (data) { 12 | console.log('First subscriber: ' + data); 13 | }); 14 | 15 | // Raising FirstEvent 16 | em.emit('FirstEvent', 'This is my first Node.js event emitter example.'); 17 | 18 | // Raising SecondEvent 19 | em.emit('SecondEvent', 'This is my second Node.js event emitter example.'); 20 | -------------------------------------------------------------------------------- /UNIT 4/eventLoop_understanding.js: -------------------------------------------------------------------------------- 1 | const perimeter = function(a,b){ 2 | return 2*(a+b); 3 | } 4 | const showPerimeter = function(){ 5 | console.log(perimeter(2,2)); 6 | } 7 | const start = function(){ 8 | console.log('Initailizing.....'); 9 | console.log('Getting Started.....'); 10 | setTimeout(showPerimeter,10000); 11 | console.log('Ending program.....'); 12 | console.log('Exiting.....'); 13 | } 14 | start(); -------------------------------------------------------------------------------- /UNIT 4/eventemitter.js: -------------------------------------------------------------------------------- 1 | var events=require("events"); 2 | var eventEmitter= new events.EventEmitter(); 3 | var myEventHandler=function() 4 | { 5 | console.log("i love Icecream"); 6 | } 7 | eventEmitter.on("cream",myEventHandler); 8 | eventEmitter.emit("cream"); -------------------------------------------------------------------------------- /UNIT 4/findall.js: -------------------------------------------------------------------------------- 1 | var MongoClient = require('mongodb').MongoClient; 2 | var url = "mongodb://localhost:27017/"; 3 | MongoClient.connect(url, function(err, db) { 4 | if (err) throw err; 5 | var dbo = db.db("3k"); 6 | dbo.collection("customers").find({}).toArray(function(err, 7 | result) { 8 | if (err) throw err; 9 | console.log(result); 10 | db.close(); 11 | }); 12 | }); 13 | -------------------------------------------------------------------------------- /UNIT 4/httpHeader.js: -------------------------------------------------------------------------------- 1 | var http = require('http'); 2 | 3 | http.createServer(function (req, res) { 4 | 5 | // response header to display content as html 6 | 7 | res.writeHead(200, {'Content-Type':'text/html'}) 8 | 9 | // Write response to client 10 | 11 | res.write('Hi Guest
'); 12 | 13 | res.write('Welcome to Class'); 14 | 15 | res.end(); 16 | 17 | }).listen(4200, console.info("Server listening on port 4200")); -------------------------------------------------------------------------------- /UNIT 4/httprequestclient.js: -------------------------------------------------------------------------------- 1 | const http = require('http'); 2 | 3 | const options = { 4 | hostname: 'localhost', 5 | port: 8081, 6 | path: '/admin', 7 | method: 'GET' 8 | }; 9 | var callback= function(response){ 10 | var body=""; 11 | response.on('data', function(data){ 12 | body+=data; 13 | }); 14 | 15 | //binds an event with its event handler 16 | response.on('end', function(){ 17 | console.log(body); 18 | }); 19 | response.on('error', (err) => { 20 | 21 | console.error(err); 22 | }); 23 | 24 | 25 | }; 26 | const req = http.request(options, callback); 27 | 28 | req.end(); -------------------------------------------------------------------------------- /UNIT 4/httprequestserver.js: -------------------------------------------------------------------------------- 1 | var http = require('http'); // Import Node.js core module 2 | 3 | var server = http.createServer(function (req, res) { //create web server 4 | if (req.url == '/') { //check the URL of the current request 5 | 6 | // set response header 7 | res.writeHead(200, { 'Content-Type': 'text/html' }); 8 | 9 | // set response content 10 | res.write('

This is home Page.

'); 11 | res.end(); 12 | 13 | } 14 | else if (req.url == "/student") { 15 | 16 | res.writeHead(200, { 'Content-Type': 'text/html' }); 17 | res.write('

This is student Page.

'); 18 | res.end(); 19 | 20 | } 21 | else if (req.url == "/admin") { 22 | 23 | res.writeHead(200, { 'Content-Type': 'text/html' }); 24 | res.write('

This is admin Page.

'); 25 | res.end(); 26 | 27 | } 28 | else 29 | res.end('Invalid Request!'); 30 | 31 | }); 32 | 33 | server.listen(8081); //6 - listen for any incoming requests 34 | 35 | console.log('Node.js web server at port 8081 is running..'); -------------------------------------------------------------------------------- /UNIT 4/moduleExample.js: -------------------------------------------------------------------------------- 1 | var calculator = require('./calculator'); 2 | 3 | var a=10, b=5; 4 | 5 | console.log("Addition : "+calculator.add(a,b)); 6 | console.log("Subtraction : "+calculator.subtract(a,b)); 7 | console.log("Multiplication : "+calculator.multiply(a,b)); 8 | -------------------------------------------------------------------------------- /UNIT 4/openFile.js: -------------------------------------------------------------------------------- 1 | var fs = require('fs'); 2 | 3 | fs.open('input.txt', 'r', function (err, fd) { 4 | 5 | if (err) { 6 | return console.error(err); 7 | } 8 | 9 | var buffr = new Buffer.alloc(1024); 10 | 11 | fs.read(fd, buffr, 0, buffr.length, 0, function (err, bytes) { 12 | 13 | if (err) throw err; 14 | 15 | // Print only read bytes to avoid junk. 16 | if (bytes > 0) { 17 | console.log(buffr.slice(0, bytes).toString()); 18 | } 19 | 20 | // Close the opened file. 21 | fs.close(fd, function (err) { 22 | if (err) throw err; 23 | }); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /UNIT 4/pipe_stream.js: -------------------------------------------------------------------------------- 1 | var fs = require('fs'); 2 | var readableStream = fs.createReadStream('input.txt'); 3 | var writableStream = fs.createWriteStream('file1.txt'); 4 | 5 | readableStream.pipe(writableStream); -------------------------------------------------------------------------------- /UNIT 4/readFile.js: -------------------------------------------------------------------------------- 1 | var fs = require('fs'); 2 | 3 | fs.readFile('TestFile.txt','utf8', function (err, data) { 4 | if (err) throw err; 5 | 6 | console.log(data); 7 | }); -------------------------------------------------------------------------------- /UNIT 4/renameFile.js: -------------------------------------------------------------------------------- 1 | var fs = require('fs'); 2 | 3 | //Rename the file "mynewfile1.txt" into "myrenamedfile.txt": 4 | fs.rename('TestFile.txt', 'myrenamedfile.txt', function (err) { 5 | if (err) throw err; 6 | console.log('File Renamed!'); 7 | }); 8 | -------------------------------------------------------------------------------- /UNIT 4/setInterval.js: -------------------------------------------------------------------------------- 1 | // function printHello() { 2 | // console.log( "Hello, World!"); 3 | // } 4 | 5 | // // Now call above function after 2 seconds 6 | // setInterval(printHello, 2000); 7 | 8 | setInterval(function() { 9 | console.log("setInterval: Hey! 1 millisecond completed!.."); 10 | }, 1000); -------------------------------------------------------------------------------- /UNIT 4/setTimeout.js: -------------------------------------------------------------------------------- 1 | function printHello() { 2 | console.log( "Hello, World!"); 3 | } 4 | 5 | // Now call above function after 2 seconds 6 | setTimeout(printHello, 2000); -------------------------------------------------------------------------------- /UNIT 4/update.js: -------------------------------------------------------------------------------- 1 | var MongoClient = require('mongodb').MongoClient; 2 | var url = "mongodb://127.0.0.1:27017/"; 3 | MongoClient.connect(url, function(err, db) { 4 | if (err) throw err; 5 | var dbo = db.db("3k"); 6 | var myquery = { address: "Apple st 652" }; 7 | var newvalues = { $set: {name: "Mickey", address: "Canyon 123" } }; 8 | dbo.collection("customers").updateOne(myquery, newvalues, function(err, 9 | res) { 10 | if (err) throw err; 11 | console.log("1 document updated"); 12 | db.close(); 13 | }); 14 | }); 15 | -------------------------------------------------------------------------------- /UNIT 4/writeFile.js: -------------------------------------------------------------------------------- 1 | var fs = require('fs'); 2 | 3 | fs.writeFile('test.txt', 'Hello World!', function (err) { 4 | if (err) 5 | console.log(err); 6 | else 7 | console.log('Write operation complete.'); 8 | }); -------------------------------------------------------------------------------- /UNIT 5/AnchorCodes/FileUpload.txt: -------------------------------------------------------------------------------- 1 | const express = require("express"); 2 | const fileupload = require("express-fileupload"); 3 | const fs=require("fs"); 4 | 5 | const app = express(); 6 | 7 | app.use(fileupload()) 8 | 9 | app.get('/',(req,res) => { 10 | //var retform="
"; 11 | res.sendFile(__dirname + '/index.html') 12 | }) 13 | 14 | app.post('/',(req,res) => 15 | { 16 | if(req.files) 17 | console.log(req.files); 18 | 19 | var file = req.files.file; 20 | var filename=file.name 21 | console.log(filename) 22 | file.mv('./files/' + filename,function(err) 23 | { 24 | if(err){ 25 | res.send(err) 26 | }else 27 | { 28 | res.send("File "+file.name+" uploaded!!") 29 | } 30 | 31 | }) 32 | }) 33 | 34 | 35 | app.listen(3000,function(){ 36 | console.log("Server up at 3000") 37 | }); -------------------------------------------------------------------------------- /UNIT 5/AnchorCodes/Form(pug).txt: -------------------------------------------------------------------------------- 1 | html 2 | html 3 | head 4 | 5 | body 6 | form(action = "/", method = "POST") 7 | div 8 | label(for = "first") First name: 9 | input(name = "first" value = "Web") 10 | br 11 | div 12 | label(for = "last") Last name: 13 | input(name = "last" value = "Technology") 14 | br 15 | button(type = "submit") Submit -------------------------------------------------------------------------------- /UNIT 5/AnchorCodes/Formdata.txt: -------------------------------------------------------------------------------- 1 | var express = require('express'); 2 | var bodyParser = require('body-parser'); 3 | var multer = require('multer'); 4 | var upload = multer(); 5 | var app = express(); 6 | 7 | app.get('/', function(req, res){ 8 | res.render('form'); 9 | }); 10 | 11 | app.set('view engine', 'pug'); 12 | app.set('views', './views'); 13 | 14 | app.use(bodyParser.json()); 15 | app.use(bodyParser.urlencoded({ extended: true })); 16 | //form-urlencoded 17 | // for parsing multipart/form-data 18 | app.use(upload.array()); 19 | app.use(express.static('public')); 20 | 21 | app.post('/', function(req, res){ 22 | console.log(req.body); 23 | res.send("recieved your request!"); 24 | }); 25 | app.listen(3000); -------------------------------------------------------------------------------- /UNIT 5/AnchorCodes/Middleware-static.txt: -------------------------------------------------------------------------------- 1 | //middleware static 2 | var express = require('express'); 3 | //const path=require('path'); 4 | var app = express(); 5 | //const router = express.Router(); 6 | app.use(express.static('folder1')); 7 | app.listen(process.env.port || 3000); 8 | 9 | console.log('Running at Port 3000'); 10 | 11 | //folder1 contains html,css,img files -------------------------------------------------------------------------------- /UNIT 5/AnchorCodes/cookie.js: -------------------------------------------------------------------------------- 1 | var express = require("express"); 2 | 3 | var app = express(); 4 | 5 | var cookieParser = require("cookie-parser"); 6 | 7 | app.use(cookieParser()); 8 | 9 | app.get("/",function(req,res){ 10 | console.log(req.cookies.uname); 11 | //console.log(res.cookie("uname")); 12 | res.cookie("uname", "expressuser",{sameSite:true,secure:true}).send("Cookie set!!") 13 | }) 14 | app.get("/setexp",function(req,res){ 15 | console.log(req.cookies.uname); 16 | res.cookie("uname","newuser",{maxAge:5000}).send("Cookie set!!") 17 | }) 18 | app.get("/delete",function(req,res){ 19 | console.log(req.cookies.uname); 20 | res.clearCookie("uname").send("Cookie cleared!!") 21 | }) 22 | app.listen(3000,function(){ 23 | console.log("Server up at 3000") 24 | }) -------------------------------------------------------------------------------- /UNIT 5/AnchorCodes/err_handling.txt: -------------------------------------------------------------------------------- 1 | var express= require("express") 2 | 3 | var app= express(); 4 | 5 | app.use("/student",function(err,req,res,next){ 6 | 7 | console.log(err.stack); 8 | 9 | res.send(500).send("Something went wrong") 10 | 11 | }) 12 | 13 | app.get("/student/:id",function(req,res,next){ 14 | 15 | if(req.params.id.indexOf("2000")!=-1){ 16 | 17 | var err = new Error("Something went Wrong!!!") 18 | 19 | next(err) 20 | 21 | } 22 | 23 | else{ 24 | 25 | res.send("Everything is fine with"+req.params.id) 26 | 27 | next(); 28 | 29 | } 30 | 31 | app.use("/student",function(req,res){ 32 | 33 | console.log("I am Fine") 34 | 35 | }) 36 | 37 | }) 38 | 39 | app.listen(3000,function(){ 40 | 41 | console.log("Server is listening on port 3000") 42 | 43 | 44 | 45 | }) -------------------------------------------------------------------------------- /UNIT 5/AnchorCodes/exp.js: -------------------------------------------------------------------------------- 1 | var express = require("express"); // npm install express --save 2 | 3 | var app = express(); 4 | var MongoClient = require("mongodb").MongoClient; 5 | var bodyParser = require('body-parser'); 6 | 7 | app.use(bodyParser.json()); //populates req.body with the req message body or leaves it as null object 8 | 9 | app.get("/", function(req, res){ 10 | res.send("Welcome to my page!!!") 11 | }) 12 | 13 | //var hellorouter = require("./hello.js") 14 | 15 | //app.use("/hello", hellorouter); // http://localhost:3000/hello 16 | 17 | var studrouter = require("./student.js") 18 | 19 | app.use("/student", studrouter); // http://localhost:3000/student 20 | app.get("/student",function()) 21 | app.listen(3000, function(){ 22 | console.log("Server listening on 3000...") 23 | }); -------------------------------------------------------------------------------- /UNIT 5/AnchorCodes/exp_mw.js: -------------------------------------------------------------------------------- 1 | var express = require("express"); // npm install express --save 2 | 3 | var app = express(); 4 | 5 | // Middleware Functions 6 | // request - response (life cycle of a request) 7 | 8 | // authentication 9 | // parsing request 10 | // response header (compression) 11 | // Router 12 | 13 | app.use(function(req, res, next){ 14 | //task 15 | console.log("First MW Function") 16 | next(); 17 | }) 18 | 19 | app.use("/", function(req, res, next){ 20 | //task 21 | console.log("Route MW Function 1") 22 | next(); 23 | }) 24 | 25 | app.use("/", function(req, res, next){ 26 | //task 27 | console.log("Route MW Function 2") 28 | next(); 29 | }) 30 | 31 | app.get("/", function(req, res, next){ 32 | console.log("Route Function") 33 | res.send("Welcome to my page!!!") 34 | next(); 35 | }) 36 | 37 | app.use("/", function(req, res, next){ 38 | //task 39 | console.log("Route MW Function 3") 40 | next(); 41 | }) 42 | 43 | app.use(function(req, res){ 44 | //task 45 | console.log("Last MW Function") 46 | //next(); 47 | }) 48 | 49 | app.listen(3000, function(){ 50 | console.log("Server listening on 3000...") 51 | }); -------------------------------------------------------------------------------- /UNIT 5/AnchorCodes/hello.js: -------------------------------------------------------------------------------- 1 | var express = require("express"); // npm install express --save 2 | 3 | var router = express.Router(); 4 | //var MongoClient = require("mongo").MongoCLient; 5 | 6 | router.get("/", function(req,res){ 7 | res.send("Hi There!!!") 8 | // MongoClient.collection("hello").find({}) 9 | }) 10 | router.get("/:sid", function(req,res){ 11 | // localhost/student/1234 12 | // localhost:3000/hello?msg=greeting - querystring 13 | res.send("Hi There, Greetings!!!") 14 | req.query // => {} req.query.dept req.query.rtype 15 | //req.params.msg 16 | // MongoClient.collection("hello").find({dept:req.query.dept}) 17 | }) 18 | 19 | 20 | 21 | router.post("/", function(req,res){ //creation of resource 22 | res.send("Hello Greeting Message saved!") 23 | //req.body 24 | // MongoClient.collection("hello").insert(req.body) 25 | }) 26 | router.put("/:id",function(req,res){ //modification of resource 27 | res.send("Hello Greeting Message updated!") 28 | // MongoClient.collection("hello").update({srn:req.params.id},{studentprofile:skjjgksfgsfgnsfngk}) //BLOB 29 | }) 30 | router.delete("/", function(req,res){ 31 | res.send("Hello Greeting Message deleted!") 32 | // MongoClient.collection("hello").delete({}) 33 | }) 34 | 35 | module.exports = router; 36 | -------------------------------------------------------------------------------- /UNIT 5/AnchorCodes/index.js: -------------------------------------------------------------------------------- 1 | var express = require('express'); 2 | var app = express(); 3 | app.use(function(req,res,next){ 4 | console.log("Got request at "+new Date().toString()) 5 | //for(i in req) 6 | // console.log(req[i]) 7 | next() 8 | }) 9 | app.use('/', function(req,res,next){ 10 | console.log("Middleware 1 ") 11 | //for(i in req) 12 | // console.log(req[i]) 13 | next() 14 | }) 15 | app.get('/', function(req, res,next){ 16 | res.send("Hello world!"); 17 | next() 18 | }); 19 | app.use('/', function(req,res,next){ 20 | console.log("Middleware 2") 21 | //for(i in req) 22 | // console.log(req[i]) 23 | next() 24 | }) 25 | app.use(function(req,res){ 26 | console.log("Middleware 3") 27 | //for(i in req) 28 | // console.log(req[i]) 29 | }) 30 | 31 | app.get('/welcome/:id', function(req, res){ 32 | res.send("Welcome to the Express "+req.params.id) 33 | }) 34 | app.listen(3000); -------------------------------------------------------------------------------- /UNIT 5/Application_level_middleware.js: -------------------------------------------------------------------------------- 1 | //Application-level middleware 2 | var express = require('express') 3 | var app = express() 4 | 5 | app.get('/user/:id', function (req, res, next) { 6 | console.log('Request Type:', req.method) 7 | next() 8 | }) 9 | app.listen(3000); -------------------------------------------------------------------------------- /UNIT 5/Unit5.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adithya-m08/WT-Programs/8f3e37a39ba2ed942fca1b2580f9980a2daf1a7c/UNIT 5/Unit5.pdf -------------------------------------------------------------------------------- /UNIT 5/bodyparser.js: -------------------------------------------------------------------------------- 1 | var express = require('express') 2 | var bodyParser = require('body-parser') 3 | 4 | var app = express() 5 | 6 | // create application/json parser 7 | var jsonParser = bodyParser.json() 8 | 9 | // create application/x-www-form-urlencoded parser 10 | var urlencodedParser = bodyParser.urlencoded({ extended: false }) 11 | 12 | // POST /login gets urlencoded bodies 13 | app.post('/login', urlencodedParser, function (req, res) { 14 | res.send('welcome, ' + req.body.username) 15 | }) 16 | 17 | // POST /api/users gets JSON bodies 18 | app.post('/api/users', jsonParser, function (req, res) { 19 | // create user in req.body 20 | }) 21 | 22 | app.listen(3000) -------------------------------------------------------------------------------- /UNIT 5/bodyparser1.js: -------------------------------------------------------------------------------- 1 | var express = require('express') 2 | const bodyParser = require('body-parser'); 3 | var app = express() 4 | 5 | // To parse URL encoded data 6 | app.use(bodyParser.urlencoded({ extended: false })); 7 | 8 | // To parse json data 9 | app.use(bodyParser.json()); 10 | 11 | app.listen(2300); -------------------------------------------------------------------------------- /UNIT 5/cookie1.js: -------------------------------------------------------------------------------- 1 | var express = require("express"); 2 | 3 | var app = express(); 4 | 5 | var cookieParser = require("cookie-parser"); 6 | 7 | app.use(cookieParser()); 8 | 9 | app.get("/",function(req,res){ 10 | console.log(req.cookies.uname); 11 | console.log(res.cookie("uname")); 12 | res.cookie("uname", "expressuser",{sameSite:true,secure:true}).send("Cookie set!!") 13 | }) 14 | app.get("/setexp",function(req,res){ 15 | console.log(req.cookies.uname); 16 | res.cookie("uname","newuser",{maxAge:5000}).send("Cookie set!!") 17 | }) 18 | app.get("/delete",function(req,res){ 19 | console.log(req.cookies.uname); 20 | res.clearCookie("uname").send("Cookie cleared!!") 21 | }) 22 | app.listen(3000,function(){ 23 | console.log("Server up at 3000"); 24 | }) -------------------------------------------------------------------------------- /UNIT 5/cookie11.js: -------------------------------------------------------------------------------- 1 | var express = require('express') 2 | var cookieParser = require('cookie-parser') 3 | 4 | var app = express() 5 | app.use(cookieParser()) 6 | 7 | app.get('/', function (req, res) { 8 | // Cookies that have not been signed 9 | console.log('Cookies: ', req.cookies) 10 | 11 | // Cookies that have been signed 12 | console.log('Signed Cookies: ', req.signedCookies) 13 | }) 14 | 15 | app.listen(8080); -------------------------------------------------------------------------------- /UNIT 5/cookie111.js: -------------------------------------------------------------------------------- 1 | var express = require('express'); 2 | var cookieParser = require('cookie-parser'); 3 | var app = express(); 4 | app.use(cookieParser()); 5 | 6 | app.get('/cookieset',function(req, res){ 7 | res.cookie('cookie_name', 'cookie_value'); 8 | res.cookie('company', 'WEB Tech'); 9 | res.cookie('name', 'ABC'); 10 | 11 | res.status(200).send('Cookie is set'); 12 | }); 13 | app.get('/cookieget', function(req, res) { 14 | res.status(200).send(req.cookies); 15 | }); 16 | app.get('/', function (req, res) { 17 | res.status(200).send('Welcome to cookie CLass!'); 18 | }); 19 | var server = app.listen(8000, function () { 20 | var host = server.address().address; 21 | var port = server.address().port; 22 | console.log('Example app listening at http://%s:%s', host, port); 23 | }) -------------------------------------------------------------------------------- /UNIT 5/cookieparser.js: -------------------------------------------------------------------------------- 1 | var express = require('express') 2 | var cookieParser = require('cookie-parser') 3 | 4 | var app = express() 5 | app.use(cookieParser()) 6 | 7 | app.get('/', function (req, res) { 8 | // Cookies that have not been signed 9 | console.log('Cookies: ', req.cookies) 10 | 11 | // Cookies that have been signed 12 | console.log('Signed Cookies: ', req.signedCookies) 13 | }) 14 | 15 | app.listen(8080); -------------------------------------------------------------------------------- /UNIT 5/errorhandling.js: -------------------------------------------------------------------------------- 1 | var express = require('express'); 2 | var app = express(); 3 | 4 | app.get('/', function(req, res){ 5 | //Create an error and pass it to the next function 6 | var err = new Error("Something went wrong"); 7 | next(err); 8 | }); 9 | 10 | /* 11 | * other route handlers and middleware here 12 | * .... 13 | */ 14 | 15 | //An error handling middleware 16 | app.use(function(err, req, res, next) { 17 | res.status(500); 18 | res.send("Oops, something went wrong.") 19 | }); 20 | 21 | app.listen(3000); -------------------------------------------------------------------------------- /UNIT 5/express_server.js: -------------------------------------------------------------------------------- 1 | const express = require('express') 2 | const app = express(); 3 | app.listen(3000, () => { 4 | console.log('Server running on localhost:3000'); 5 | }); -------------------------------------------------------------------------------- /UNIT 5/fileupload.js: -------------------------------------------------------------------------------- 1 | const express = require('express'); 2 | const fileUpload = require('express-fileupload'); 3 | const path= require('path'); 4 | const app = express(); 5 | 6 | app.use(fileUpload()); 7 | app.get('/',function(req,res){ 8 | res.sendFile(path.join(__dirname+'/upload.html')); 9 | //__dirname : It will resolve to your project folder. 10 | }); 11 | 12 | app.post('/upload', function(req, res) { 13 | 14 | if (req.files){ 15 | console.log(req.files); //view object structure 16 | var uploadedFile=req.files.sampleFile; // The name of the input field (i.e. "sampleFile") in upload.html 17 | var uploadedFile_name= uploadedFile.name; 18 | var uploadedFile_size= uploadedFile.size; 19 | 20 | 21 | //create a directory called uploads 22 | uploadedFile.mv('./uploads/'+ uploadedFile_name, function(err){ 23 | if (err){ 24 | console.log(err); 25 | } 26 | res.send(uploadedFile_name+ ' of size' + uploadedFile_size+ ' uploaded!'); 27 | }); 28 | } 29 | }); 30 | app.listen(8080); 31 | 32 | 33 | -------------------------------------------------------------------------------- /UNIT 5/form.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Form 4 | 5 | 6 |
7 | 8 | 9 |
10 | 11 | -------------------------------------------------------------------------------- /UNIT 5/form_1.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Form 5 | 6 | 7 |
8 | 9 | 10 |
11 | 12 | -------------------------------------------------------------------------------- /UNIT 5/formserver.js: -------------------------------------------------------------------------------- 1 | const express = require('express') 2 | const app = express() 3 | const path = require('path'); 4 | app.use(express.urlencoded({ 5 | extended: true 6 | })); 7 | app.post('/submit-form', (req, res) => { 8 | const username = req.body.username 9 | res.send("

Welcome " + username + "

"); 10 | }); 11 | 12 | app.get('/',function(req,res){ 13 | res.sendFile(path.join(__dirname+'/form.html')); 14 | //__dirname : It will resolve to your project folder. 15 | }); 16 | app.listen(8080); 17 | -------------------------------------------------------------------------------- /UNIT 5/formserver_1.js: -------------------------------------------------------------------------------- 1 | const express = require('express') 2 | const app = express() 3 | const path = require('path'); 4 | const url = require('url'); 5 | 6 | app.get('/submit-form', (req, res) => { 7 | const username = url.parse(req.url, true).query.username; 8 | res.send("

Welcome " + username + "

"); 9 | }); 10 | 11 | app.get('/',function(req,res){ 12 | res.sendFile(path.join(__dirname+'/form_1.html')); 13 | }); 14 | app.listen(8081); 15 | -------------------------------------------------------------------------------- /UNIT 5/index.js: -------------------------------------------------------------------------------- 1 | var express = require('Express'); 2 | var app = express(); 3 | 4 | var things = require('./things.js'); 5 | 6 | //both index.js and things.js should be in same directory 7 | app.use('/things', things); 8 | 9 | app.listen(3000); -------------------------------------------------------------------------------- /UNIT 5/middleware.js: -------------------------------------------------------------------------------- 1 | const express = require('express'); 2 | const app = express(); 3 | 4 | // Simple request time logger 5 | app.use((req, res, next) => { 6 | console.log("A new request received at " + Date.now()); 7 | 8 | // This function call tells that more processing is 9 | // required for the current request and is in the next middleware function/route handler. 10 | next(); 11 | }); 12 | 13 | app.get('/home', (req, res) => { 14 | res.send('Home Page'); 15 | }); 16 | 17 | app.get('/about', (req, res) => { 18 | res.send('About Page'); 19 | }); 20 | 21 | app.listen(3000, () => console.log('Example app listening on port 3000!')); -------------------------------------------------------------------------------- /UNIT 5/middleware3.js: -------------------------------------------------------------------------------- 1 | var express = require('express'); 2 | var app = express(); 3 | 4 | const middleware = (req,res,next)=>{ 5 | console.log("Hello am Middleware function"); 6 | // next(); 7 | } 8 | 9 | app.get('/',function(req,res){ 10 | res.send("

Welcome to Express JS Home page

"); 11 | }); 12 | app.get('/login',middleware,function(req,res){ 13 | res.send("

Login Here!!!

") 14 | }); 15 | app.get('/contact',middleware,function(req,res){ 16 | res.send("

Contact US

"); 17 | }) 18 | // other HTTP methods are, app.get(),app.post(),app.put(),app.delete() 19 | var server = app.listen(5000); -------------------------------------------------------------------------------- /UNIT 5/middleware_1.js: -------------------------------------------------------------------------------- 1 | //logs request based on time 2 | var express= require('express'); 3 | var app=express(); 4 | 5 | //middleware function 6 | var requesttime= function(req,res,next){ 7 | req.requestTime=Date.now(); 8 | next(); //calls next middleware 9 | } 10 | //how to use the middleware? using app.use 11 | 12 | app.use(requesttime); 13 | app.get('/', function(req,res){ 14 | var responseText='A request was made!
'; 15 | responseText+="Time of request : " + req.requestTime; 16 | res.send(responseText); 17 | }); 18 | app.listen(8081); -------------------------------------------------------------------------------- /UNIT 5/middleware_2.js: -------------------------------------------------------------------------------- 1 | var express= require('express'); 2 | var app=express(); 3 | app.use('/user/:id', function(req,res,next){ 4 | 5 | if (req.params.id==0){ 6 | res.send("Provide another id!"); 7 | } 8 | else{ 9 | next(); 10 | } 11 | }); 12 | //give all routes 13 | app.get("/",function(req,res){ 14 | res.send("Welcome"); 15 | 16 | 17 | }); 18 | app.get("/user/:id",function(req,res){ 19 | res.send("ID: " + req.params.id); 20 | 21 | }); 22 | 23 | app.get("/user/:id/hello",function(req,res){ 24 | res.send("Hello ID: " + req.params.id); 25 | 26 | }); 27 | 28 | app.listen(8081, function(){ 29 | console.log("Server is running") 30 | }); 31 | 32 | -------------------------------------------------------------------------------- /UNIT 5/middlewareorder.js: -------------------------------------------------------------------------------- 1 | var express= require('express'); 2 | var app=express(); 3 | //change the order of the middleware functions and observe what happens 4 | 5 | app.use('/user/:id', function(req,res,next){ 6 | console.log("ID:" + req.params.id); 7 | next(); 8 | }); 9 | app.use(function(req,res,next){ 10 | console.log("/" + req.method); 11 | next(); 12 | }); 13 | app.get("/",function(req,res){ 14 | res.send("Welcome"); 15 | }); 16 | app.get("/user/:id",function(req,res){ 17 | res.send("ID: " + req.params.id); 18 | }); 19 | app.listen(8080, function(){ 20 | console.log("Server is running") 21 | }); 22 | 23 | -------------------------------------------------------------------------------- /UNIT 5/middlewareorder_2.js: -------------------------------------------------------------------------------- 1 | var express= require('express'); 2 | var app=express(); 3 | app.get("/user/:id",function(req,res){ 4 | res.send("ID: " + req.params.id); 5 | }); 6 | app.use('/user/:id', function(req,res,next){ 7 | if (req.params.id==0){ 8 | res.send("Provide another id!"); 9 | } 10 | else{ 11 | next(); 12 | } 13 | }); 14 | 15 | app.get("/",function(req,res){ 16 | res.send("Welcome"); 17 | }); 18 | app.get("/user/:id",function(req,res){ 19 | res.send("ID: " + req.params.id); 20 | }); 21 | 22 | app.listen(8081, function(){ 23 | console.log("Server is running") 24 | }); 25 | 26 | -------------------------------------------------------------------------------- /UNIT 5/middlewareorder_3.js: -------------------------------------------------------------------------------- 1 | var express = require('express') 2 | var app = express() 3 | 4 | var myLogger = function (req, res, next) { 5 | console.log('LOGGED') 6 | // next() 7 | } 8 | 9 | app.use(myLogger) 10 | 11 | app.get('/', function (req, res) { 12 | res.send('Hello World!') 13 | }) 14 | 15 | app.listen(3000) -------------------------------------------------------------------------------- /UNIT 5/requestlogging.js: -------------------------------------------------------------------------------- 1 | const express = require('express'); 2 | const app = express(); 3 | 4 | app.use((req, res, next) => { 5 | console.log(req); 6 | next(); 7 | }); 8 | 9 | app.get('/', (req, res, next) => { 10 | res.send('Welcome Home'); 11 | }); 12 | 13 | app.listen(3000); 14 | 15 | -------------------------------------------------------------------------------- /UNIT 5/routing.js: -------------------------------------------------------------------------------- 1 | var express = require('express'); 2 | var app = express(); 3 | 4 | app.get('/getabout', function (req, res) { 5 | res.send("GET Request Received at /getabout"); 6 | }); 7 | app.post('/postfeedback', function (req, res) { 8 | console.log("POST Request Received at /postfeedback"); 9 | res.send('Feedback Page'); 10 | }) 11 | app.delete('/deletepost', function (req, res) { 12 | res.send('DELETE Request Received at /deletepost'); 13 | }); 14 | app.put('/post', function (req, res) { 15 | res.send('PUT Request Received at /post') 16 | }) 17 | app.listen(3000); -------------------------------------------------------------------------------- /UNIT 5/things.js: -------------------------------------------------------------------------------- 1 | var express = require('express'); 2 | var router = express.Router(); 3 | 4 | router.get('/', function(req, res){ 5 | res.send('GET route on things.'); 6 | }); 7 | router.post('/', function(req, res){ 8 | res.send('POST route on things.'); 9 | }); 10 | 11 | //export this router to use in our index.js 12 | module.exports = router; -------------------------------------------------------------------------------- /UNIT 5/upload.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |

Upload a file!

4 |
8 | 9 | 10 |
11 | 12 | 13 | -------------------------------------------------------------------------------- /UNIT 5/urlbuilding.js: -------------------------------------------------------------------------------- 1 | var express = require('express'); 2 | var app = express(); 3 | 4 | app.get('/:id', function(req, res){ 5 | res.send('The id you specified is ' + req.params.id); 6 | }); 7 | 8 | app.listen(3000); --------------------------------------------------------------------------------