1. Name of variable
Name of method (hump naming method)
All lowercase: All underscores between words and words (my_namespace)
Mixed case: First letter lowercase other words in uppercase.
Rules
First character English letter or underline
Make
"Add event mechanism" AddEventListener and attachevent
[The consortium]
AddEventListener (' click ', function () {alert (' Hello World ')}, FALSE)//W3C specification add event (IE8 and above incompatible); The first parameter is the event type,
This tab effect, I have seen a good tab effect, not the best, but also very good
javascript tab (tab) browsing control referral: domtab-javascript, Domtab, tab, tab, PHP/MySQL (X) html/css Ajax homr.cn
-DIV+CSS Small
Copy Code code as follows:
function keyPress (EV) {
if (ev.keycode==13) {
Creates an area at the cursor location.
var range=document.selection.createrange ();
Sets the content of the range to a newline character.
Range.text= "\ n";
The This property represents the current object, or refers to the current Page Object window if this is used globally, and if this is used in a function, this refers to what is invoked on the object based on this function at run time. We can also
1. The most basic usage assigns an instance of ClassA to ClassB,
CLASSB inherits all the attributes of the ClassA.
Code in:
[Ctrl + A All SELECT Note: If the need to introduce external JS need to refresh to perform]
2. From
Copy Code code as follows:
var jsobject = {} | | New Object ();
Jsobject.extend = function (subclass, superclass) {
First, determine if the subclass subclass is already defined, or redefine the class if it is undefined.
if (typeof subclass =
The previous sections talk about JavaScript-oriented namespaces, JavaScript-oriented JavaScript classes, private members of JavaScript-oriented objects, and public members and JavaScript-oriented overloading, so you can look at the above and
Or to decide on the title of Ajax, after all, many people will use this keyword search. Although I think this is just a hype concept, but have to admit that Ajax is more convenient to call. I'm not going to elaborate on the meaning of Ajax.
The
What do you say?! Like an animal (a combination of objects), when it has a descendant (a leaf object), its descendants have some function (such as digging a hole, hearing well, etc.); it's like a tree, It has a root (a combination of objects) and
This time we look directly at the example:
Copy Code code as follows:
/*** defines a static class ***/
var Staticclass = (function () {
var return = {
Property: ' Test Static ',//public properties
Method:function () {//Public
When it comes to JS object-oriented, we have to mention prototype this JS built-in properties (note: The prototype here is not prototype.js), its role is to be able to dynamically add some attributes to an object. All I have to do now is to get the
In JS Development, we may encounter such a problem
When you need to dynamically insert HTML tags through JS
In particular, when encountered a large number of variable stitching, quotation marks layer nesting situation, there will be escape
Following IE instead of Internet Explorer, MF replaces Mozzila Firefox
1. Document.form.item question(1) Existing problems:There are many Document.formName.item ("itemname") statements in existing code that cannot be run under MF(2) Solution:Switch
The example in this article describes the method of JavaScript array to weight. Share to everyone for your reference, specific as follows:
Method one.
Idea: Create a new empty array, loop through the old array, and use the indexof () method to get
*** review Fresh fruit Reply
pizicai comment you Reply
function Fillinmessagearea (othis) {
var text = Othis.parentnode.childnodes[0].firstchild.nodevalue;
Text = ' reply ' + text;
Text + ': ';
var Me_area = $ (' #message_area
Remove first space
Copy Code code as follows:
Str=str.replace (/^\s+|\s+$/g, "");
JS Regular Expression Delete string before and after space
String.prototype.trim=function () {
var respace=/^\s* (. *?) \s*$/;
Return
How can I change the color of the textarea scroll bar and button, and how to make the scroll bar flatten rather than highlight
Thank you, I don't have much.
1 floor
Scrollbar-highlight-color: #e7dbbd;
Scrollbar-shadow-color:
Agenda &L T;p align=center> year month &
LT;TD colspan= "3" align= "center" > today:
;/div>
[Ctrl + A All SELECT Note: If the need to introduce external JS need to refresh to perform]
This paper introduces a more general method to get the checkbox value, which is helpful to the novice.
Copy Code code as follows:
Like radio, it is the same name, there are multiple values, we can't follow the normal text box
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.