Skip to content

Latest commit

 

History

History
97 lines (82 loc) · 2.31 KB

javascript.org

File metadata and controls

97 lines (82 loc) · 2.31 KB

JavaScript

JavaScript

JavaScript is a cross-platform,object-oriented programming language.It is a small and lightweight language.

Client Side || Server Side

Javascript is all about making content of web document dynamic.

JavaScript can do…

  • Provides HTML designers a programming Tool
  • Can put dynamic test into HTML/ read and write in html documents
  • Can react to events
  • can be used to validate data
  • .......

Popular Javascript Frameworks

  • Angular*JS
  • ReactJS
  • NodeJS
  • VueJS
  • EmberJS
  • MeteorJS

Data Types in Javascript

  • Boolean
  • Null
  • Undefined
  • Number
  • String
  • Objects

Basics of JavaScript

  • Everything is case sensitive
  • variables are loosely typed
        	// integer 
        	var a = 10;
        	// string 
        	var favoriteColor = "red";
        	// boolean 
        	var canDriveCar = false;
        
  • var keyword is used
  • variables need not have to be declared before using

Document Object Model (DOM)

  • application programming interface(API) for valid HTML documents.It defines the logical structure of documents and the way a document is accessed and manipulated.

DOM…

  • A web page is a document
  • DOM provides the way to represent,store and manipulate the document(web page).
  • Object Oriented representation of web page
  • DOM is not a programming language

Some DOM methods

  • document.getElementById(“id”)
  • document.getElementsByTagName(name)
  • document.getElementsByClassName(name)
  • document.createElement(name)
  • parentNode.appendChild(node)
  • element.innerHTML
  • element.style.*
  • element.setAttribute(attribute,value)
  • element.getAttribute
  • element.addEventListener
  • document.appendChild(element)
  • document.replaceChild(element)
  • document.write(text)