
JavaScript
iceman1952
这个作者很懒,什么都没留下…
展开
-
[JavaScript] Nested Functions as Closures
// This function returns a function each time it is called// The scope in which the function is defined differs for each callfunction make原创 2010-09-12 21:59:00 · 641 阅读 · 0 评论 -
[JavaScript] Script 中 function, variable 的定义会提升到函数执行前面;但是,function 中定义的 global variable 则不会被提升
1、Script 中 function, variable 的定义 会提升到函数执行前面2、但是,function 中定义的 global variable 则不会被提升 function demoForIn(){ //只有此 functio原创 2011-09-10 11:34:52 · 1111 阅读 · 2 评论 -
[JavaScript] JavaScript中的类型,竟然也有继承关系。好吧,这个以后得好好看
function demoInheritance(){ //会打印出:myProp:Hello Marvin var str1 = new String("ABC"); for(var tmpName in str1){ alert(tmpNam原创 2011-09-12 21:32:01 · 722 阅读 · 1 评论 -
[JavaScript] typeof 返回什么值?
function demoDatetype(){ alert(typeof "I'm string literal");//string alert(typeof new String("I'm string object"));//object原创 2011-09-12 15:34:15 · 1305 阅读 · 1 评论 -
[JavaScript] Constructor 以及 Prototype
一、任何一种类型的对象(Date, Object, String, RegExp, Array, Boolean)都有 constructor 属性constructor 属性 指向 此 类型 对象的 constructor function(Date(), Object()原创 2011-09-14 22:46:15 · 821 阅读 · 1 评论 -
[JavaScript] Closure In JavaScript
function methodLayer1() { var layer1Variable = "I'm Layer 1 variable"; alert("methodLayer1:" + xyz); return ( fun原创 2011-09-18 21:57:59 · 605 阅读 · 0 评论 -
CSS后代选择器
代码如下: p {text-align: center;} .important {color: red;} p.important {background:silver;} /* 完全等同于:p[class="important"] {background:silver;} */ .important div {background: purple;} /* 注意原创 2011-10-22 18:14:40 · 1946 阅读 · 0 评论 -
理解 JavaScript 的 this 关键字
贴此图,作为 [译]理解Javascript关键字this 的注解,此图也参考了 11.2.3 Function Calls11.2.3 Function Calls # Ⓣ The production CallExpression : MemberExpression Arguments is evaluated as follows:Let原创 2011-10-25 13:27:24 · 588 阅读 · 0 评论 -
理解 JavaScript 的 this 关键字(代码)
里面的代码展示了各种情况下,this应该是什么值 function callAsProperty(){ var a = { b: function(){ alert(this); utilityDisplay(this); return this; } } a.b();//b's this-->a a['b']();//原创 2011-10-25 16:22:17 · 548 阅读 · 0 评论 -
Cross-Origin Resource Sharing (CORS)
尚未完整,待细化本文总结于:https://developer.mozilla.org/en-US/docs/Glossary/CORS本文参考了:https://fetch.spec.whatwg.org/#cors-request CORS时,何时会发CORS-preflight request下面任意一个条件被满足时,就会发CORS-preflight request。即...原创 2019-01-30 07:02:36 · 841 阅读 · 0 评论 -
跨域时(cross-origin) Access-Control-Allow-Credentials对 CORS-actual request的response 的影响
本文参考了:https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Credentials概述Access-Control-Allow-Credentials唯一的合法值是小写的true(大小写敏感)。如果不需要credentials,直接不设置该header,不要设置false...原创 2019-02-28 10:33:43 · 3279 阅读 · 0 评论 -
[JavaScript] Object 如何转换成 number
原创 2011-09-10 21:38:58 · 2699 阅读 · 0 评论 -
[JavaScript] Defining and Invoking Functions
function Definition1、若直接 return; 则 caller 得到 undefined2、若根本没有 return xxxx; 出现在 function 中,则 caller 得到undefined3、如果传的 多了,则多出的被ignore;原创 2011-09-07 22:16:41 · 575 阅读 · 0 评论 -
[JavaScript]Functions as Methods
function1、 function就是数据值(data values)2、 定义此 function 的名字没有任何特殊之处3、 可以将 function 分配给任何 variable 或者 某对象的任何一个 propertymethod1、原创 2011-09-06 22:06:38 · 1165 阅读 · 0 评论 -
[JavaScript] How similar it is with Swing, so it seems coding swing is very helpful for me
How similar it is with Swing, so it seems coding swing is very helpful for me原创 2010-10-09 22:04:00 · 478 阅读 · 0 评论 -
[JavaScript] null in Velocity
Precondition VelocityContext context = new VelocityContext(); context.put("nullPlacedInJava", null); 1. Error happen#if ($nullPl原创 2010-10-10 17:29:00 · 630 阅读 · 0 评论 -
[JavaScript] In Velocity, CANNOT assign null to LRS
If the RHS is a property or method reference that evaluates to null, it willnot be assigned to the LHS E.G. Precondition Veloci原创 2010-10-10 17:43:00 · 928 阅读 · 0 评论 -
HTML中,content="text/html; charset=gb2312";XML中 encoding="UTF-8"。其实都是指的 “程序员告诉别人,我的此html文档所使用的字符编码,但是
HTML中,content="text/html; charset=gb2312";XML中 encoding="UTF-8" 其实都是指的 “编码集,而不是字符集”,即指的“如何对字符进行编码;而不是目前使用何种字符集”,更确切的讲 指的 “程序员告诉别人,我的此htm原创 2011-05-09 21:19:00 · 13100 阅读 · 0 评论 -
[JavaScript] Defining and invoking functions, Function Arguments
Chapter 8When a function is invoked on an object, the function is called a method, and the object on which it is invoked is passed as an原创 2010-09-08 22:31:00 · 742 阅读 · 0 评论 -
[JavaScript] null and undefined
nullnull is usually considered a special value of object type, a value that represents no object.When a variable holds the value null, y原创 2011-09-04 13:08:49 · 1169 阅读 · 0 评论 -
[JavaScript] Access the properties of an object
1. object does not have the property of length, so if you need to iterate properties of the object, you can only functi原创 2011-09-04 13:36:04 · 667 阅读 · 0 评论 -
[JavaScript] 关于Javascript、Html、Jsp的注释
关于Javascript、Html、Jsp的注释http://leowzy.javaeye.com/blog/566097原创 2011-09-04 13:48:25 · 569 阅读 · 0 评论 -
JavaScript--Function, Variable作用域
一、在执行JavaScript语句前,首先将所有的declaration都提到其所在scope的顶部(注意:只提取declaration,不提取initialization) 也就是说,解释器在执行某个函数或者initialize某个变量前,首先将这些内容提取到其所在scop原创 2010-12-24 14:30:00 · 1144 阅读 · 0 评论 -
[JavaScript] Function Properties and Methods
arguments其实就是此函数体内的一个对象,arguments.length 指的是此函数被调用时,实际的参数arguments.callee.length 此函数的期待的参数个数(当然,这个没啥意义,因为,JavaScript中,调用函数时,参数放多少个都无所谓)原创 2011-09-05 22:23:58 · 753 阅读 · 0 评论 -
跨域时(cross-origin),XMLHttpRequest.withCredentials对cookie的影响
本文参考了:https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/withCredentials 概述XMLHttpRequest.withCredentials不止控制着 browser-->server的request中 是否携带credentials信息,还控制着前端JavaScript如何使用 se...原创 2019-02-25 23:39:10 · 1902 阅读 · 1 评论