This blog must be written, it wasted me a morning's time. In order to quickly find this error in the future, save more time.
The situation is this: I wrote a background management system is referencing Marix admin, because this system contains
The way Javascript generates HTML elements is described in this article in 2, the first is a more formal method of creating elements, and the second is to use the Write () method in JavaScript to write HTML elements directly.
Method One:
Copy Code code as follows:
Menu
Database
MySQL
sql server
Oracle
DB2
Foreground script
JavaScript
Ruby
HTML
Python
Background script
PHP
ASP
ASP.NET
JSP
Master Detour! This has nothing to do with the closure of the relationship, also do not know how to take the title, casually gather the number, hope forgive!Today, a friend just learn JS gave me a piece of code to ask why the method does not execute,
JavaScript is a magical language, there is no magic in the language of a magic plus operator.
The common additive operators we can use to do:
1. Addition operation, for example: Alert (1+2); ==>32. String connection, for example: Alert ("a" + "B");
Copy Code code as follows:
function DeleteAll () {
var all = Document.getelementsbyname ("CheckName");/Get what you selected is an array
if (all = NULL | | all.length = 1) {
Alert ("No Order Pending");
Return
} else {
var idstr =
The host is uploading a reference to the browser
//to the corresponding element object function
Candrag (drager) {
Drager.onmousedown = function (down) {
var OFFX = Drager.offsetleft
var offy = drager.offsettop;
var offxl =
Are you curious about how many recursive calls a JavaScript engine can make?
How many times recursive calls
The following function allows you to find the answer: (Inspired by Ben Alman's Gist)
Copy Code code as follows:
function
In JavaScript, you can specify an event for an element in the following three ways:1, in HTML, using the OnClick property2, in JavaScript, using the OnClick property3. In Javascipt, use the Addevenlistener () method
Comparison of three methods(1)
Someone might say what format it is?Actually, it's more than that.1//11.2//1.21.2e3//12001.2e+3//12001.2e-3//0.0012.12e+2//12-.12e-2//-0.0012
Of course, these are only decimal. Let's say octal and hexadecimal.0x00, 0x11, 0xff This format is
The Calculates the correctness of the last one according to the ID number, and if it is incorrect, it will give the correct result, a very interesting procedure.
javascript 18-digit ID number last check code
First, the use of basic classesMethod One:
Copy Code code as follows:
function Sth (a)//constructor
{
THIS.A = A;
This.fun = output; member functions
}
function output (A, B, c){document.write (THIS.A);}
Callvar s =
For example:
And in JS how to traverse assignment?Program code
var count=0;
for (I=0 i
See another way to use DOM (but try not to try it out, I don't know why)
a monk has water to drink. two
JavaScript traversal table
1, the description
Iterate through a column of a row in a table and print its value
2, the realization of the source code
javascript traversal table School Number name age sex 2014010101 Zhang
1, the description
(1) Returns a reference or node to the element based on the ID value of the provided element
document.getElementById ("tr_th")
(2) Returns a reference or node to a set of elements according to the tag in the
In yesterday's "JavaScript Authority Guide" Learning notes ten: ECMAScript 5 Enhanced object Model in the article, for a piece of code debugging there is a strange phenomenon, the source code is affixed to the following:
Copy Code code as
Directly on the code bar, with JS control at the cursor position inserted.
In the realization of the expression of the insertion used.
Copy Code code as follows:
Purpose insert text at the cursor stop in the TEXTAREA by
Use range:
OA, MIS, ERP and other information management projects, the site is not considered for the time being.
The problems encountered:
To complete a project, often need to refer to a lot of JS files, such as Jquery.js, Easyui and so on. Also
Did you see the war of focus between Germany and Portugal last night? In the early hours of the Beijing game, Ronaldo led the Portuguese 0-4 Germany was finished ... He is the Golden Globe winner, the European boot, the Champions League champions,
In JavaScript, in order to perform different actions for different elements, you need to judge the elements that trigger the event in JavaScript, and then perform different actions.
Example:
Html
Copy Code code as follows:
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.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service