Casie Bao


All the lights we cannot see


React

Accessing a Global Variable

The window is the global object in the browser environment. Any property attached to the window object can be accessed from any script on the web page, including the script for the React app.

Accessing any property via the window object makes it evident that it is defined and set globally.

For example, in one of our project, Andy defines a lot of global variables, and access them in different components. In this way, we don’t need to worry about inheritence, passing variables as paramters from parent component to child components.

DOM (Document Object Model)

  • 文档对象模型 (DOM) 是HTML和XML文档的编程接口。它提供了对文档的结构化的表述,并定义了一种方式可以使从程序中对该结构进行访问,从而改变文档的结构,样式和内容。
    paragraphs = document.getElementsByTagName("P");
    // paragraphs[0] is the first <p> element
    // paragraphs[1] is the second <p> element, etc.
    alert(paragraphs[0].nodeName);
    
Latest Articles

Java

JDK vs JRE vs JVM JDK – Java Development Kit (in short JDK) is Kit which provides the environment to develop and execute(run) the Java program. JDK is a kit(or package) which includes two thin...…

Read More
Eariler Articles

System Design

Load-Balancing Goal: help developing a scalable app, allow distributing loads across servers based on metrics such as random, round-robin, random with weighting for memory or cpu utilization etc. ...…

Read More