![](https://img-blog.csdnimg.cn/20201014180756919.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
JavaScript
文章平均质量分 85
Agile牧
最重要的,拥有跟随内心与直觉的勇气,你的内心与直觉多少已经知道你真正想要成为什么样的人。任何其它事物都是次要的。
展开
-
JavaScript DOM Demo
t.getElementById("info").innerHTML = "<h1>Hello World</h1>"; }</script></head><body> <form action="" method="post"> &am原创 2012-06-10 21:52:58 · 106 阅读 · 0 评论 -
JS实现键盘Enter键提交表单
e = e.keyCode; } if (keycode === 13 ) { //回车键是13 if(googleFlag) { loginWithGoogle(); // 需要google验证登录 } else { loginWithoutGoogle(); // 不需要google验证登录 } }}function isFirefox(){ if (navigator.userAgent.indexOf("Fir原创 2017-06-28 15:01:20 · 345 阅读 · 0 评论 -
JS Typical Questions
ote:a 被关键字var声明,说明 a 是这个函数的局部变量,所以函数外打印 a, 会显示错误 not defined,b 没有被关键字var声明,JS默认 b 是一个全局作用域,所以函数外打印 b,会显示 5 另外如果使用 'use strict'; 会直接报错(function() { 'use strict'; var a = b = 5;})();console.log(a);console.log(b);ReferenceError: b原创 2017-04-21 10:56:45 · 68 阅读 · 0 评论 -
JSON.parse() & JSON.stringify()
t JSON.stringify()Demo var str = {a: 1, b: 2, c: "test"};console.log(JSON.stringify(str));Console Output原创 2017-01-10 14:16:56 · 128 阅读 · 0 评论 -
JavaScript Object Properties —— Preventing Object Modification
ways to do so. Preventing ExtensionsIf you use Object.preventExtensions(), objects will no longer allow properties to be added.var person1 = { name: "Nicholas"};console.log(Object.isExtensible(person1)); // trueObject.preven原创 2016-11-30 16:52:26 · 67 阅读 · 0 评论 -
JavaScript Object Properties —— Property attributes
Common AttributesBoth data and accessor properties have [[Enumerable]] and [[Configurable]] attributes.var person1 = { name: "Nicholas"};Object.defineProperty(person1, "name", { enumerable: false});console.l原创 2016-11-30 16:37:24 · 83 阅读 · 0 评论 -
JavaScript Object Properties —— Enumeration, Types of Properties
etrieved by Object.keys().var listProperties1 = function (object) { var property; for (property in object) { console.log("Name: " + property); console.log("Value: " + object[property]); }}var l原创 2016-11-29 21:16:07 · 76 阅读 · 0 评论 -
JavaScript Object Properties —— Define, Detect, Remove
literal. For example:var person1 = { name: "Nicholas"};var person2 = new Object();person2.name = "Nicholas";person1.age = "Redacted";person2.age = "Redacted";person1.name = "Greg";per原创 2016-11-29 20:46:10 · 119 阅读 · 0 评论 -
JavaScript Object Methods
lobal scope, this represents the global object (window in web browsers). When a function is called while attached to an object, the value of this is equal to that object by default. So, instead of directly referencing an object inside a method, you can ref原创 2016-11-29 14:06:19 · 70 阅读 · 0 评论 -
JavaScript Function Overloading
tion expects. JavaScript functions can accept any number of parameters, and the types of parameters a function takes aren’t specified at all. That means JavaScript functions don’t actually have signatures. A lack of function signatures also means a lack of原创 2016-11-29 11:00:09 · 86 阅读 · 0 评论 -
JavaScript Function Declarations vs. Function Expressions
yword and includes the name of the function immediately following it. The contents of the function are enclosed in braces, as shown in this declaration:function add(num1, num2) { return num1 + num2;} The second form is a function expression, w原创 2016-11-29 10:20:16 · 82 阅读 · 0 评论 -
JavaScript Primitive Wrapper Types
There are three primitive wrapper types (String, Number, and Boolean). These special reference types exist to make working with primitive values as easy as working with objects. (It would be very confusing if you had to use a different syntax or switch to原创 2016-11-28 21:39:27 · 138 阅读 · 0 评论 -
JavaScript Primitive and Reference Types
are stored as simple data types.Reference types are stored as objects, which are really just references to locations in memory. Primitive TypesPrimitive types represent simple pieces of data that are stored as is, such as true and 25.There are f原创 2016-11-28 15:03:48 · 132 阅读 · 0 评论 -
JavaScript Object-Oriented Programming -- Inheritance
ed, and implementation inheritance, where actual methods are inherited. Interface inheritance is not possible in ECMAScript, because functions do not have signatures. Implementation inheritance is the only type of inheritance supported by ECMAScript, and t原创 2012-06-14 05:23:41 · 76 阅读 · 0 评论 -
JavaScript Object-Oriented Programming -- Object Creation
, job) { var p = new Object(); p.name = name; p.age = age; p.job = job; p.sayName = function() { alert(this.name); }; return p;} var person1 = createPerson("Nicholas", 29, "Software Engineer");var person2 = cr原创 2012-06-14 00:35:30 · 54 阅读 · 0 评论 -
JavaScript Functions
llowed by a set of arguments and then the body of the function. The basic syntax is as follows: function functionName(arg0, arg1, ... , argN) { statements} Here are some examples.Example01// Function Example 1function sayHi(name, me原创 2012-06-11 20:07:36 · 70 阅读 · 0 评论 -
JS DES加密
原创 2017-06-29 15:41:28 · 535 阅读 · 0 评论