GithubHelp home page GithubHelp logo

learnjs's Introduction

JavaScript学习笔记

很多东西学习以后会忘记,希望记录下来

1.DOM零级事件

  • 先对HTML中的DOM进行查询/检索,然后再对该Dom对象绑定一个事件,只不过这个事件是匿名函数
  • 说到匿名函数就不得不说this方法,ES5中和ES6中匿名函数的变化导致this的指向不同
btn.onclick = function(){
    console.log(this) //这里的this 仅仅指的就是对btn这个DOM元素的引用
}
// ES6 
btn.onclick = ()=>{
    console.log(this) //这里的this 并不是对当前元素的引用
}
  • 检测一个值是不是数字isNaN(value)==false
  • 事件触发调用函数不写()
    • ex: window.onload = Fname;

learnjs's People

Contributors

tonysmark avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.