1. A simple exampleFirst, from a classic error, there are a number of div on the page, we want to bind them an onclick method, and then have the following code ulID= "Divtest"> Li>0Li> Li>1Li> Li>2Li> Li>3Li> ul>ulID= "DivTest2">
1 //function function: Create a random integer within 10 after 1 seconds, and determine if the number is even, and if it is even, do one thing, and if it is odd, do another thing .2 functiondosomthing () {3 varPromise
I. Overview
The so-called Singleton pattern, as the name implies, is only one instance of a class.So, when we create an instance, we have to determine if it already exists, and if it already exists, return to the existing instance,
Online to see an interview question: "If the background to the front tens of thousands of data, how to render the front end to the page?" "And how to answer?" So the office boiling, colleagues discussed open, you say a word I speak my plan. Some say
Error-related debugging and processing is a particularly important skill in development.Try-catchLet's look at the following scenario:1 // Nonefunc This method does not exist 2 Window.nonefunc (); 3 // JS Error after the termination of the operation
"Declaration and invocation of functions"format of the 1.>>> function declaration: Formal parameters can be declared without Vardeclare using the function keyword:function Name (parameter 1, parameter 2,......) {//function Bodyreturn result;} >>>
First, the question:Window.onload=function () {var bar=1;function Test () {Console.log (bar);}Test ();};Result is 1Window.onload=function () {var bar=1;function Test () {Console.log (bar); var bar=2;Console.log (bar);}Test ();};The result is
There is a problem when using Ajax to leave a message. Since the message content is written, the content is submitted via Ajax, and the content of the message is added to the page using JS. When you view the message, it is also requested by Ajax and
JavaScript data types are divided into primitive types (primitive type) and reference types (complex type).First, the original typeJavaScript has 5 primitive types (primitive type), that is, Undefined, Null, Boolean, number, and String.1.Number
One colleague told everyone he saw an interview on the Internet: "If the background is passed to the front tens of thousands of data, how does the front end render to the page?" "And how to answer?" So the office boiling, colleagues discussed open,
/* External referenceSingle-line Comment/* Multiline Comment */A newline can represent the end of a statement, or it can be added withoutInteger: int single-Precision decimal:Float double-precision decimal:Double decimal:Decimal currency type:Money
1. OnClick Event Click event (onclick is not the method in JS, the onclick is just a DOM interface that the browser provides JS, so that JS can manipulate the DOM, so the onclick case is no problem, such as the HTML code is not case-sensitive)
Common css attribute Methods: Part 1: css attribute MethodsI switched from the java background to the front-end by myself, so I will not write some simple css + html at ordinary times. I will list some of the attributes that are commonly used by
The input length dynamically changes with the input content. The input cursor locates at the rightmost, and the input cursor
4? This. value. length: 4); "size =" 4 ">
the default size is 20.
If you define the width attribute in the style and want
Bootstrap date control (solve problems such as double date and empty) and bootstrap Control
Bootstrap makes it the most popular front-end framework with its elegant appearance and rich components. During project development, we encountered some
Describe my blog, describe blog
Flowers in our hands, and the veins of every leaf have miraculous signs. They record our tracks of life. Some leaves fall and wither, and some leaves grow again. Even if the world changes, the world is impermanence,
Html/css: changes the parent attributes of child inheritance. css inherits
A beautiful webpage requires many styles. The font color or size set on the parent is not necessarily the same among its child elements. What should I do if I want to change
Less learning notes (1), less learning notes (
The less statement is as follows:. Content {Ul {List-style: none;}Li {Height: 25px;Line-height: 25px;Padding-left: 15px;Background: url ("arr.jpg") no-repeat center left;A {Text-decoration: none;Color: #
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.