A few days ago, when it comes to JS, try not to use eval, but what exactly is eval? Today we're going to talk about the eval thing.
First look at this definition:
Definitions and usage
The eval () function computes a string and executes the
For example, the following user object:
The code is as follows
Copy Code
function user (n, a){THIS.name = n;This.age = A;this.tostring = function () {Return "Name:" + THIS.name + ", Age:" + this.age;}}var u = new User
Usually when we create a script tag on our page, either SRC introduces the external JS file:
?
1
Either write the content directly in the label:
?
1
2
3
The script tag has an
Conditional statementWhen you write code, you often need to perform different behaviors according to different conditions. You can use conditional statements in your code to
Complete this task.
In JavaScript, we can use the following conditional
In addition to using all of the DOM-related operations described above, the form element has its own set of properties and methods to simplify.In addition to supporting mouse, keyboard, change and HTML time, forms also support some form-specific
1. Short Circuit logicIn a logical operation, if the previous condition can already draw the final conclusion, all subsequent conditions are no longer executed! The logical operation here refers to logic and logic or.We have to understand that the
Scope in a functionThe so-called function scope, that is, all the variables that belong to this function can be used and reused throughout the scope of the function.1 function foo (a) {2 var b=a;3 function Bar (c) {4
JavaScript Object-oriented and prototypeLearning Essentials:1. Learning conditions2. Create an Object3. Prototypes4. InheritanceECMAScript has two development modes: 1. Functional (procedural), 2. Object-oriented (OOP). An object-oriented language
How do I make clocks using IFRAME tags and javascript? How do you make a clock? The effect is as follows:The clock here will go on and on, but the page below is not going to be, so we can achieve the desired effect. Below I will be divided into the
Jquery calendar plug-in e-calendar upgraded version, jquerye-calendar
The jQuery Event calendar plug-in e-calendar allows you to customize a calendar for a specified date (no limit on the number of entries). The calendar date is highlighted and
Detailed description of JavaScript ID card number validation and instance code, and detailed description of javascript
Recently, you need to verify the validity of your ID card. real-name verification is not expected. However, the original
Example of the front-end shopping cart function plug-in implemented by JS + HTML5 [Download demo source code] And html5demo
This article describes the front-end shopping cart function plug-in implemented by JS + HTML5. We will share this with you
Resumable upload and JavaScript resumable upload of front-end files based on javascript
Take the image as an example to see the final look.
I. Prepare some knowledge
Resumable data transfer, since there is a break, there should be a file separation
Conditional rendering for mini-program tutorials
Series of articles:
Mini-program tutorial-WXSSReferences to mini-program tutorialsEvents of mini-program tutorialsSmall Program tutorial TemplateList rendering of Applet tutorialsConditional rendering
Examples of the mini-program navigator component
Navigator redirects are divided into two states: closing the current page and not closing the current page. Use the redirect attribute.
Main attributes:
Wxml
click to jump not to close the current
Use the trim () method in JQuery to remove leading and trailing spaces.
As follows:
Function bt_submit () {var $ title = $. trim ($ ("# title "). val (); if ($ title = '') {ShowMessage (" carrier name cannot be blank "," # ff0000 "); return;}
Xml html xhtml html5, xhtmlhtml5
1. XMLWhat is XML?
XML refers to the EXtensible Markup Language (EXtensible Markup Language)
XML is a markup language, similar to HTML
XML is designed to transmit data rather than display data.
The XML tag is
HTML form, html formHTML forms contain form elements.
element definition HTML form
Form elements refer to different types of input elements, check boxes, single-choice buttons, and submit buttons.
HTML forms are used to collect different types of
Emmet plug-ins are commonly used in writing and emmet plug-ins
I read some documents about the Emmet plug-in writing. How can I write it so long. Actually, I know a few rough points, and I can write my work in combination with my
Question 1: ScopeCheck out the following code:(Function (){Var a = B = 5;})();Console. log (B); what will be output in the result?Answer:5The main points of this question are two different scopes. 'A' is declared as a local variable by var, but 'B'
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.