how to develop a website using javascript

2022.03.15

Have you already sure it?htmlandcss,But I don't know where to join hands.JavaScript?

if,Then this article will definitely help you.,Summary here5Suggestion,helpJavaScriptBeginners summarize learning methods,Improve learning efficiency。

1. See more video less books

For beginners,The efficiency of reading the book is very low,Most of the contents of the book will showcase core code,And video for demo,Explain all code。The initiator is self-study, it is all code.,Just look at the core code will leave the pit。so,Beginners must see more photos。

2. The time to write code is more than reading and watching the video.

LearnJavaScript,Be sure to write,Not looking for。Half more than half of the study time to leave the code,The rest of the time is used to read a book and watch the video。Almost all beginners have this problem,That's a book(Or video)Look3I didn't write an hour but a line of code.。This result is,3Up to it is only used hours1Hours。It's too waste time.。The correct learning method is:Write a line of code when you see a line of code,Even if you understand,Copy and then copy,Then go slowly。

3. Not blindly recapitated

  • react,vue,angular,nothing dealing with you
  • node,express,koa,nothing dealing with you
  • grunt,gulp,webpack,nothing dealing with you
(how to develop a website using javascript)JavaScriptThese years have changed very quickly,But for beginners to abandon impetuous atmosphere,Quietly to lay the foundation。remember:I am a beginner.,Playing something is:JavaScriptandjQuery,Tools use an editor and a browser,These are enough,Don't touch anything else.

4. jQueryLast time

Some friends will sayjQueryI have been eliminated.,jQueryIt is really destined to be eliminated,But now it is far away.。

first,jqueryFor beginners very friendly,Not evenjsYou can learnjQuery。And currently on the market and application,is stilljQueryMost,So if you are self-study,jQueryBe a must。

5. Learning order

(how to develop a website using javascript)Familiar basic concept:variable,type of data,function,Operator,expression,Object(Custom object,Built-in object)。

These basic concepts must be familiar with,What extent is it familiar?,See a concept,Example code can be written immediately,enough。

2.familiarDOM:Tree,Node classification,Add node,Delete node,Modify attribute,Binding event。

3.familiarjQuery:Selector、Operating properties and style、Binding event、Node operation、Animation method。

4.usejQueryImplement the page effect on the web page,Such as round broadcast,Effects of menus,Back to top, etc.。

(how to develop a website using javascript)5.Try to use nativejsaccomplishjQueryCommon method。for exampleaddClass,removeClass,indexThese。

above5If you can't do it,Don't think about closing,Prototype inheritance,ES6New feature these things

JavaScript Introduction

JavaScript It is the most popular programming language in the world.。

This language can be used HTML and web,More extensive for servers、PC、laptop、Devices such as tablets and smart phones。

  • JavaScript Is a scripting language
  • JavaScript Is a lightweight programming language。
  • JavaScript Be insertable HTML Page programming code。
  • JavaScript insert HTML After the page,Can be executed by all modern browsers。
  • JavaScript It's easy to learn。
  • JavaScript:Write HTML Output
(how to develop a website using javascript)Example

document.write("<h1>This is a heading</h1>");
document.write("<p>This is a paragraph</p>");

JavaScript:Reaction the event

Example

<button type="button" onclick="alert('Welcome!')">Click here</button>

alert() Function JavaScript Although it is not commonly used,But it is very convenient for code testing。

onclick Event is only one of the many events you are about to learn in this tutorial.。

JavaScript:Change HTML content

use JavaScript Handle HTML Content is very powerful。

Example

x=document.getElementById("demo")  //Find elements
x.innerHTML="Hello JavaScript";    //Change content

You will often see document.getElementByID("some id")。This method is HTML DOM Defined。

DOM(Document object model)Is for access HTML Formal elements W3C standard。

JavaScript:Change HTML image

This example will dynamically change HTML <image>origin of (src):

(how to develop a website using javascript)The Light bulb

Click on the bulb to open or close this light

JavaScript Can change arbitrary HTML Most attributes of elements,Not just pictures。

JavaScript:Change HTML style

Change HTML Element style,Constant HTML Variety of attributes。

Example

x=document.getElementById("demo")  //Find element
x.style.color="#ff0000";           //Change style

JavaScript:Verify input

JavaScript Commonly used to verify the user's input。

Example

if isNaN(x) {alert("Not Numeric")};

JavaScriptLearning tutorial

JavaScriptLearning tutorials Recommend the small friends to see the power node Du explainwebFront end full set of tutorials,This tutorial is to instill many years of programming experience.,Typical practice,It is suitable for beginners entry,Also suitable for advanced(Learn the underlying)。

Mainly explained the core technology in front-end developmentJavaScript,Commonly known asJS,The video is explained in the video.JavaScriptCore grammar、JavaScriptBuilt-in support class、JavaScriptdebugging、JavaScript DOMProgram、JavaScript BOMProgram、A large number of front end small cases、JavaScriptEvent processing、JavaScriptObject、inherit、JSONWaiting points,This video can open youWEBFrontal road。

http://www.bjpowernode.com/?toutiaoweb.chai

Learning catalog

  • JavaScriptTutorial
  • JavaScriptLanguage Features
  • JavaScriptcomposition
  • JavaScriptmiddleBOMandDOM之间Identifier关系及主流浏览器
  • JavaScriptRelationship and mainstream browser
  • JavaScript基础语法
  • HTMLdevelopment toolsJavaScript
  • JavaScript注释
  • JavaScriptBasic syntax
  • JavaScript保留关键字
  • JavaScriptEmbedding
  • JavaScript变量
  • JavaScriptNote
  • JavaScript数据类型
  • JavaScript的typeof运算符
  • JavaScriptKey keyword
  • JavaScript Void
  • JavaScript中 null、NaNBuilt-in typeundefined的区别
  • JavaScriptvariable
  • JavaScript事件和事件句柄
  • JavaScriptfunction
  • JavaScript注册事件的方式
  • JavaScript HTML DOMtype of data
  • JavaScript HTML DOM 对象
  • JavaScript BOMof
  • JavaScript window对象
  • JavaScript historyOperatorlocation对象
  • JavaScript JSON
  • JavaScript JSON
返回列表
更多新闻资讯