This is the 26th day of my participation in the August More Text Challenge

Fostered fostered fostered the content of the learning today: (object-oriented | | class and object oriented process). Check the gaps! Do do do

Can serve as a beginner’s learning route, can refer to, learning progress is not particularly driven! Keep learning and updating

Combined with their own understanding, simple and comprehensive summary of the basic knowledge points in the process of learning JavaScript in vernacular Chinese, easy to deepen understanding!

Let’s get started! ‘Only a firm foundation can build a tall building ‘! Come on! Take it seriously!

1, comb yesterday’s knowledge:

Back-end communication – Ajax-POST/same-origin policy/Promise

  • Ajax-post/GET

    Send data: setRequestHeader(“”,””)

  • 2. Same-origin policy

  • 3. Jsonp is cross-domain

  • 4, Ajax request server file data across the domain server to achieve cross-domain: CORS

  • 5. Asynchronous objects Promise

    • Three states: Pengding Resolved Rejected

    • Execute the then method on success:

    • On failure, a catch is executed

    • Features: The state changes irreversible

2. Bootstrap UI framework

Front-end framework: HTML CSS JS package

Bootstrap is the most popular HTML, CSS, and JS framework for developing responsive layout, mobile-first WEB projects.

Features: Responsive layout

Bootstrap Chinese document is not particularly difficult to understand, you can explore by yourself

Ajax interaction with the server

Add, delete, modify and check: All data is rendered to the page after the front-end data is obtained through ajax request server

Create error table wtable

create table wtable
(
  id int primary key auto_increment,
  icontent varchar(100),
  iwhere varchar(100),
  idea  varchar(100)
)
Copy the code

List display process:

4. Object oriented

4.1 defined? What is object-oriented: OOP

Object orientation is a programming idea

Object Oriented is a software development method, a programming paradigm. — baidubaike

So what is a programming paradigm?

Programming paradigm is a model or method of Programming in a computer.

Common programming paradigms are: functional programming, program programming, object-oriented programming, instruction programming and so on.

4.2 Built-in Objects –>

Array Regular Date Math String

arr = new Array()
brr = new Array(a)Copy the code

Window JSON object Document location…

All objects have properties and methods (functions)

4.3 What is an Object?

  • Everything is an object
  • All matter having properties and behaviors
  • Everything that has properties and methods

Objects: properties and methods

All basic data types have no properties or methods

var num = 90
num.index = 1
alert(num.index)
/ / and undefined
Copy the code

All object types have properties and methods

var obj = document.getElementById(' ')
obj.index = 9
alert(obj.index)
/ / - 9
Copy the code

5. Object-oriented and procedural

Process-oriented: reflects mathematical logic

A road is 500 meters long how long will it take to walk at 20/ min to complete the road:

Time is equal to length over speed

Object oriented: reflects the logic of life

Which objects — Road: Property Length Person: Property: Speed

Time = road. Length/person. speed

Advantages and disadvantages of object orientation:

  • Advantages: independent function, easy maintenance and prevent global variable pollution

  • Disadvantages: long development cycle and high cost

6. Objects and classes

6.1 class:

A general term for a class of things that have the same properties and behavior (a class in JS is a constructor)

6.2 Relationship between Classes and Objects:

A class is an abstraction of an object, and an object is an abstraction of a class. (A class is an abstraction of an object and an object is an instance of a class)

6.3 Code implementation:

Write the class first (constructor)

Create objects based on classes


Preview: Come on, dream chasers

Learning is a continuous process, stick to it, there will be harvest!

Accumulate over a long period, consolidate the foundation, early into Dachang!

It’s not easy to keep it up, and it’s not easy to keep it up. You’re great!

Calm Down & Carry On!


Read more:

Review of previous updates

【 relearn JS】 Every day to strengthen the foundation of the series of articles:

Ajax-post/Same-origin Policy/Cross-domain /Promise

Day23 – The front end also needs to understand some databases

【day1】

Day2 various operators, DAY3 data types, DAY4 loop structures & conditional statements, DAY5 functions (emphasis), day6 scopes & events,

【 DAY7 】 object & array method summary, 【day8】 string method & partial sorting,

【 DAY9 】Math object & Wrapper Function, 【 DAY10 】BOM- Browser object model,

【 DAY11 】DOM- Document Object Model

【 DAY13 】Event Event object first known (2),

【 DAY14 】 Event delegate & Drag principle

【 DAY15 】 Drag-and-drop implementation & regular introduction, 【 DAY16 】 regular specific method,

【 DAY17 】cookie, 【day18】ES6,

[DAY19] Js motion function encapsulation

[DAY21] Study and review in the first three weeks

[DAY22] Server and client

More on the way… A long way to go ==-.. – = =