随笔分类 -  JavaScript编程

摘要:从 Vue 的官方支持我们知道,Vue 是支持服务端渲染的,而且还提供了官方渲染插件 vue-server-renderer 提供了基于 JSBundle 或 JSON 文件渲染模式和流渲染模式。 阅读全文
posted @ 2017-10-03 10:24 Blue Sky ...... 阅读(10668) 评论(0) 推荐(0) 编辑
摘要:背景 在用Node.js+Webpack构建的方式进行开发时, 我们希望能实现修改代码能实时刷新页面UI的效果. 这个特性webpack本身是支持的, 而且基于koa也有现成的koa webpack hot middleware 和 koa webpack dev middleware 封装好的组件 阅读全文
posted @ 2017-05-13 00:44 Blue Sky ...... 阅读(3794) 评论(0) 推荐(0) 编辑
摘要:1、phonegap android 插件管理器PluginManager初始化时, 是每个Activity都要初始化一次, 数据都缓存一次, 导致同一份数据缓存多次。-- 暂不清楚为啥这样实现? 难道是phonegap 框架是为单webview 实现的,如果有知道原因的请告知一下。 2、同第1点一样, Socket Server 每个Activity都会初始化一下, 如果loadUrl 的url类型不同,会不会导致scoket server状体错乱, 待验证! 3、phonegap 采用 prompt 和 XHR 轮询机制,一是会导致手机耗电情况严重, 二是了解到prompt 调用是会阻塞js执行的, 这样导致影响到页面加载速度。 阅读全文
posted @ 2015-01-11 17:39 Blue Sky ...... 阅读(22152) 评论(1) 推荐(0) 编辑
摘要:1、浏览器载入HTML,然后把它解析成DOM。 2、浏览器载入angular.js脚本。 3、AngularJS等到DOMContentLoaded事件触发。 4、AngularJS寻找ng-app指令,这个指令指示了应用的边界。 5、使用ng-app中指定的模块来配置注入器($injector)。 6、注入器($injector)是用来创建“编译服务($compile service)”和“根作用域($rootScope)”的。 7、编译服务($compile service)是用来编译DOM并把它链接到根作用域($rootScope)的。 8、ng-init指令将“World”赋给作用域里的name这个变量。 9、通过{{name}}的替换,整个表达式变成了“Hello World”。 阅读全文
posted @ 2015-01-07 11:55 Blue Sky ...... 阅读(89380) 评论(7) 推荐(11) 编辑
摘要:1、继承cordovaActivity的Native实现类 2、编写javascript代码 3、编写plugin.xml配置文件 阅读全文
posted @ 2015-01-06 22:09 Blue Sky ...... 阅读(5526) 评论(1) 推荐(0) 编辑
摘要:在项目开发时,全局scope 和 directive本地scope使用范围不够清晰,全局scope与directive本地scope通信掌握的不够透视,这里对全局scope 和 directive本地scope的使用做一个总结 阅读全文
posted @ 2015-01-04 20:24 Blue Sky ...... 阅读(15326) 评论(4) 推荐(3) 编辑
摘要:http://heikezhi.com/yuanyi/10%E4%B8%AAchrome%20console%E5%AE%9E%E7%94%A8%E5%B0%8F%E6%8A%80%E5%B7%A7http://visionsky.blog.51cto.com/733317/543789http://javascript.ruanyifeng.com/tool/console.htmlhttp://javascript.ruanyifeng.com/tool/grunt.html 阅读全文
posted @ 2013-12-17 13:24 Blue Sky ...... 阅读(267) 评论(0) 推荐(0) 编辑
摘要:面板收缩(class=collapsed)与扩展(class=expand)http://www.cnblogs.com/lcllao/archive/2012/09/09/2677190.htmlhttp://docs.angularjs.org/guide/directivehttp://www.befundoo.com/university/tutorials/angularjs-directives-tutorial/http://www.ng-newsletter.com/posts/directives.htmlhttp://seanhess.github.io/2013/10/1 阅读全文
posted @ 2013-11-30 13:48 Blue Sky ...... 阅读(2943) 评论(0) 推荐(0) 编辑
摘要:<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head> <title&g... 阅读全文
posted @ 2010-09-26 11:45 Blue Sky ...... 阅读(538) 评论(0) 推荐(0) 编辑
摘要:代码Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--<scripttype="text/javascript">functionGetObj(objStr){returndocument.getElementById(objStr);}fu... 阅读全文
posted @ 2010-08-26 14:47 Blue Sky ...... 阅读(213) 评论(0) 推荐(0) 编辑
摘要:Google Search实现其实通过传递查询关键字构建一个url,然后根据Http请求获取相关内容以json格式返回到客户端。关键是url的构建格式:http://www.google.cn/complete/search?hl=en&client=suggest&js=true&qu=" + Request.QueryString["qu"] 下面根据url创建http... 阅读全文
posted @ 2010-07-03 11:05 Blue Sky ...... 阅读(329) 评论(1) 推荐(0) 编辑
摘要:代码Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--执行左移右移函数:var$get=function(id){return"string"==typeofid?document.getElementById(id):id;};varExtend=fu... 阅读全文
posted @ 2010-07-03 10:55 Blue Sky ...... 阅读(480) 评论(0) 推荐(0) 编辑
摘要:function StringBuilder(value) { this.strings = new Array(""); this.append(value); } // Appends the given value to the end of this instance. StringBuilder.prototype.append = function (value) { if (valu... 阅读全文
posted @ 2010-07-03 10:48 Blue Sky ...... 阅读(218) 评论(0) 推荐(0) 编辑
摘要:代码Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--setInterval(fun,time)函数fun以间隔time循环执行clearInterval(timer)清除定时器setTimeout(fun,time)函数fun在time后执行一次下面实... 阅读全文
posted @ 2010-07-03 10:47 Blue Sky ...... 阅读(216) 评论(0) 推荐(0) 编辑
摘要:获取图片大小:var originImage = new Image();function GetImageWidth(oImage) { if (originImage.src != oImage.src) originImage.src = oImage.src; return originImage.width;}function GetImageHeight(oImage) { if (o... 阅读全文
posted @ 2010-07-03 10:39 Blue Sky ...... 阅读(368) 评论(0) 推荐(0) 编辑
摘要:代码Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--javascript:R=0;x1=.1;y1=.05;x2=.25;y2=.24;x3=1.6;y3=.24;x4=300;y4=200;x5=300;y5=200;DI=document.imag... 阅读全文
posted @ 2010-04-17 16:32 Blue Sky ...... 阅读(418) 评论(0) 推荐(0) 编辑
摘要:JS获取DropDownList的value值与text值 <scripttype="text/javascript"language="javascript"> functionSearchChange() { varddl=document.getElementById("DropDownList1") varindex=ddl.selectedIndex; varValue=... 阅读全文
posted @ 2010-04-07 14:29 Blue Sky ...... 阅读(616) 评论(0) 推荐(0) 编辑
摘要:function StringBuilder(value){this.strings = new Array("");this.append(value);}// Appends the given value to the end of this instance.StringBuilder.prototype.append = function (value){if (value){this.... 阅读全文
posted @ 2010-04-02 10:41 Blue Sky ...... 阅读(384) 评论(0) 推荐(0) 编辑
摘要:[代码] 阅读全文
posted @ 2009-11-09 13:11 Blue Sky ...... 阅读(702) 评论(0) 推荐(0) 编辑
摘要:IE中: document.body.clientWidth ==> BODY对象宽度 document.body.clientHeight ==> BODY对象高度 document.documentElement.clientWidth ==> 可见区域宽度 document.documentElement.clientHeight ==> 可见区域高度 FireFox... 阅读全文
posted @ 2009-10-30 02:10 Blue Sky ...... 阅读(317) 评论(0) 推荐(0) 编辑