- 浏览: 219785 次
- 性别:
- 来自: 广州
文章分类
最新评论
-
zzhyq:
有没有后台是ASHX 的呀
Ext.tree.TreePanel -
693593336:
谢谢作者分享,正好用上
Ext.tree.TreePanel -
greatwqs:
提供一个下载的demo不是更好
基于servlet的 Freemarker Demo
一些基础概念:
#1 JavaScript 对象其实就是属性的集合。属性由键值对组成。通过[属性名]这种形式则总是可以保证正确性。
#2 函数: 函数本身也是对象。
function func(id){};
相当于:
var func = function(id){};
#3 this 表示当前上下文,即调用者的引用。
#4 词法作用域 即是在定义的时候就确定下来了。
#5 scope 在执行一个函数时,函数的参数和其局部变量会作为调用对象的属性进行存储
#6 call & apply
#7 由于构造函数定义了一个对象的类,所以属性constructor在有助于确定给定对象的类型.如,可以使用如下代码来确定一个未知对象的类型:if ((typeof o == "object") && (o.constructor == Date)),也可以用instanceof运算符:if ((typeof o == "object") && (o instanceof Date))
#8 对象的引用机制:对象不会被复制,只能通过引用来传递。
var recordDefParams = [];
recordDefParams[0] = {name:'id',type:'date'}; recordDefParams[1] = {name:'version'}; recordDefParams[recordDefParams.length] = {name:'deleted'}; function func(recordDefParams){ for (var i = 0, nLen = recordDefParams.length; i < nLen; i++) { var obj = recordDefParams[i]; if (obj.type == 'date' && !obj.dateFormat) { obj.dateFormat = 'xxx-xx-x'; } } return recordDefParams; } console.dir(recordDefParams); console.log('==========================='); console.dir(func(recordDefParams));
#9
function addr(street, xno){ console.log(this); this.street = street || 'beijinglu'; this.xno = xno || '1 hao'; this.toString = function(){ return 'Street:' + this.street + ' xno:' + this.xno; }; }; var core1 = new addr(); console.log(core1.toString()); var core2 = new addr('北京路','一号'); console.log(core2.toString());
//动态构建新的匿名对象 function point(x,y){ this.x = x; this.y = y; return {'x':x,'y':y}; } var a = point(3,4); console.dir(a); for(var key in a ){ console.log(key); console.log(a[key]); }
After read the blog of "JavaScript Core chapter 10 .writer the coding below for testing.
<html> <head> <title> Js core </title> <script type="text/javascript"> //原型链 var base = { name : 'Mark', getName : function(){ return this.name; } }; var ext1 ={ id :'0', __proto__ :base }; var ext2 ={ id : '9', __proto__ : base }; //console.log(ext1.getName()); //构造器 function Task(id){ this.id = id; }; Task.prototype.status = 'defalt_begin'; Task.prototype.execute = function(args){ return 'execute task_[' + this.id + ']' + this.status + ':' + args; }; var task1 = new Task(1); var task2 = new Task(2); task1.status = 'activing'; task2.status = 'end...'; //console.log(task1.execute('task_1')); //console.log(task2.execute('task_2')); //this understander var global = this; var tom = { name : 'tom', id : '1', getInfo: function(){ console.log(this.name + ':' + this.id); } } var jetty = { name : 'jetty', getInfo : tom.getInfo //等同于 //getInfo:function (){ console.log(this.name + ':' + this.id);} 在跑构造的时候就创建好了。 } tom.getInfo(); jetty.getInfo(); global.getInfo = tom.getInfo; global.getInfo(); </script> </head> <body> js core chapter 10 & 11. </body> </html>
all : 给全局对象动态的添加一个属性。
发表评论
-
js Run Mechanism
2011-06-11 17:40 1312copy from : http://www.blogjav ... -
走马观花记二--css
2010-04-28 00:52 811css是Cascading Style Sheet(层叠样式 ... -
一个简单的Ajax登录例子
2010-06-27 10:12 9621.view(loginAjax.jsp) Code ... -
ajax的一些实例
2010-06-27 14:18 716两种引用方法: Code: //1 ... -
XHTML走马观花
2010-06-27 14:53 780其设计目的是为了实现从HTML到XML过渡,它结合了XML中部 ... -
CSS的一些实用例子
2010-06-27 15:35 710// 结合脚本语言动态的控制元素在页面中出现的位置。 ... -
DOM简介
2010-06-28 16:04 764全称是文档对象模型(Document Object Mode ... -
XML和XSTL走马观花(ajax)
2010-06-28 17:05 1232eXtensible Markup Language 的简称。 ... -
js中button事件的简单示例
2010-10-31 10:25 1146Code: <!DOCTYPEhtmlP ... -
一个简单的验证带验证提示例子
2010-11-05 23:47 816该例子的源码来源于《锋利的JQuery》这本书。Jquery ... -
网站开发必知基础(html)
2010-11-25 08:59 7971.div 定义和用法 <div> 可定义文档 ... -
Div+CSS布局入门教程
2010-12-07 23:40 724作为一个Web开发人员, ... -
jquery实例—json/xml数据格式交互
2011-04-07 10:08 990学习资料:jquery实例 来自:http://www.doc ... -
jquery版本对json数据格式接收的区别
2011-04-08 14:46 1394毕设中,做注册页面,选用jquery纯属玩玩而已的,也不知道j ... -
56个民族 下来框(常用的排序)
2011-04-08 17:12 1574<select name="select&qu ... -
js获取当前url的中文参数
2011-04-14 02:50 2846问题源自于大傻同学的需求:A.html的参数传给B.html ... -
毕设简单的登录界面
2011-04-14 11:08 1000Code: <htmlxmlns=&qu ...
相关推荐
Since 1996, JavaScript: The Definitive Guide has been the bible for JavaScript programmers—a programmer's guide and comprehensive reference to the core language and to the client-side JavaScript APIs...
Since 1996, [removed] The Definitive Guide has been the bible for JavaScript programmers—a programmer's guide and comprehensive reference to the core language and to the client-side JavaScript APIs ...
Title: Beginning JavaScript, 5th Edition Author: Jeremy McPeak Length: 768 pages ...Appendix B: Javascript Core Reference Appendix C: W3C Dom Reference Appendix D: Latin-1 Character Set
Chapter 10: Messaging Patterns Chapter 11: Microservices Chapter 12: Patterns for Testing Chapter 13: Advanced Patterns Chapter 14: ECMAScript-2015/2016 Solutions Today Module 3: Functional ...
Data Wrangling with JavaScript teaches readers core data munging techniques in JavaScript, along with many libraries and tools that will make their data tasks even easier. Table of Contents Chapter ...
Chapter 10: Strings, Math, and Dates. Chapter 11: Scripting Frames and Multiple Windows. Chapter 12: Images and Dynamic HTML. Part III: Document Objects Reference. Chapter 13: JavaScript ...
The book first explores the core concepts of functional programming common to all functional languages, with examples of their use in JavaScript. It's followed by a comprehensive roundup of functional...
Chapter 2: Building the Data Access Layer with Entity Framework Core Chapter 3: Building the RESTful Service with ASP.NET Core MVC Services Chapter 4: Introducing ASP.NET Core MVC Web Applications ...
CHAPTER 10 Rich Data Controls 385 CHAPTER 11 Caching and Asynchronous Pages 451 CHAPTER 12 Files and Streams 497 CHAPTER 13 LINQ 531 CHAPTER 14 XML 587 PART 3 Building ASP.NET Websites CHAPTER ...
This book is for anyone wanting to learn about Redux, a predictable state container for JavaScript apps. It is aimed at intermediate developers who have a good understanding ...Chapter 10. Going offline
4. **编程语言与框架**:"Accp6.0"可能是指某种编程语言或框架,如Java的Spring Boot或.NET的ASP.NET Core。学生需要熟练掌握相关语言特性和框架的使用方法。 5. **前端开发**:HTML、CSS和JavaScript是基础,可能...
Early Realease Take your web development skills from browser to server with ...Chapter 10. Full-stack Node Development Chapter 11. Node in Development and Production Chapter 12. Node in New Environments
Chapter 1: Core JavaScript and JavaScript Frameworks Chapter 2: Overview of Ext JS 4 Chapter 3: Understanding the Ext JS 4 API Chapter 4: Controls and Layout Chapter 5: Working with Data Chapter 6: ...