07 2011 档案

动态加载外部javascript文件
摘要:只是做个记录,以后不要自己满街找代码。。。(function (clover) { clover.loadScript = function loadScript(url, callback) { var heads = document.getElementsByTagName('head'); if (heads.length == 0) { alert("page must have one head element"); } var head = heads[0]; var script = document.createElement('s 阅读全文

posted @ 2011-07-27 22:39 听说读写 阅读(511) 评论(2) 推荐(0) 编辑

javascript 代码质量检查工具
摘要:http://www.jslint.com/#JSLINT_OPTIONS唉 就像页面的提示一样。。。这东西真的是非常打击你对你的javasccript的信心 阅读全文

posted @ 2011-07-23 23:48 听说读写 阅读(362) 评论(0) 推荐(0) 编辑

(面向c#开发人员) 编写javascript的好习惯九 匿名自执行函数
摘要:(function (customFun, name) { // alert(name); var aa = 1; customFun.popup = function (yy) { alert(aa); } })(window.customFun = window.customFun || {}, "test"); window.customFun.popup(2); 阅读全文

posted @ 2011-07-23 23:27 听说读写 阅读(263) 评论(0) 推荐(0) 编辑

(面向c#开发人员) 编写javascript的好习惯八 变量和函数声明
摘要:为了防止变量和函数冲突 一般都要考虑使用namespace var value1 = "value1"; //不好的定义变量的方式 value2 = "value2"; //不好的定义变量的方式 function company_method() {//不好的定义函数的方式 } //正确的方式,命名空间,防止冲突 var companyName = function () { var value3 = "value3"; var method = function () { } } 阅读全文

posted @ 2011-07-23 22:14 听说读写 阅读(248) 评论(0) 推荐(0) 编辑

(面向c#开发人员) 编写javascript的好习惯七 闭包1
摘要:闭包是一个很强大的功能,但是也很不容易用好下面是一个负面教材 <ul id="ul1"> </ul> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js"></script> <script> for (var i = 0; i < 10; i++) { $("<li />", { id: i, text: "link " + i, cl 阅读全文

posted @ 2011-07-23 21:33 听说读写 阅读(261) 评论(0) 推荐(0) 编辑

Quick Start - WCF 4.0 RESTful Service Setup
摘要:1.建立一个 Asp.net Website / WebApplication2. 引用 System.ServiceModel 系列的dll3. 添加以下的类和接口View Code [ServiceContract]// define a service contract interface IPersonService { [OperationContract] Person GetPerson(string id); [OperationContract] Person InsertPerson(Person person); [OperationContract] Person Up 阅读全文

posted @ 2011-07-23 11:47 听说读写 阅读(404) 评论(0) 推荐(0) 编辑

JQuery Template Engine 简介 1
摘要:现在的web开发用到javascript越来与多,其中jquery已经是事实上最流行的javascript library了经常我们会使用javascipt来操作 dom/html 例如 html="<a href='#'>test </a>";不过这样的代码难以维护和阅读JQuery1.4.3 以及以上的版本已经支持了template engine的功能 (当然,还有很多第三方的实现,例如microsoft template engine, 不过我还是喜欢build-in的功能,,不要额外下载js文件 不用担心兼容性的问题)说了这么 阅读全文

posted @ 2011-07-06 21:15 听说读写 阅读(1278) 评论(0) 推荐(0) 编辑

导航

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5
点击右上角即可分享
微信分享提示