上一页 1 2 3 4 5 6 ··· 14 下一页
摘要: XMLHttpRequest.upload 在Firefox, Google Chrome and Safari中,如果通过XMLHttpRequest上传文件,是可以通过监听XMLHttpRequest.upload对象的progress事件来查看进度的。 var xhr = new XMLHttpRequest(); xhr.upload.addEventListener("progress"... 阅读全文
posted @ 2011-08-05 15:22 MK2 阅读(6129) 评论(3) 推荐(1) 编辑
摘要: Buffer不会被GC? 为了看看这个问题,我写了一段测试代码 var http = require('http') , os = require('os'); function create(size, res) { var mb = 1024 * 1024; res.write('free ' + os.freemem() / mb + 'MB\r\n'); res.write('------... 阅读全文
posted @ 2011-07-20 00:16 MK2 阅读(4910) 评论(0) 推荐(0) 编辑
摘要: 起因 看到simple todo的各种python版本实现, 我也来凑凑热闹...既然已经有这么多python版本了, 我就对比实现了一个Simple-TODO的nodejs版本: Node TODO, 模版和樣式全部copy自web.py版本. Source Code && Demo 源代码: https://github.com/fengmk2/todo 在线demo: http://api.... 阅读全文
posted @ 2011-07-07 15:18 MK2 阅读(5316) 评论(4) 推荐(0) 编辑
摘要: 问题:如何获取Chrome插件版本号 翻遍了Chrome插件开发文档,依然无法找到如何获取当前版本号。仔细想想,版本号其实就在开发者配置的manifest.json文件上定义的,如果能读取此文件数据,就等于得到版本号信息了。 解决 没错,请求manifest.json文件,读取version数据。 var version = null; $.get(chrome.extension.getURL(... 阅读全文
posted @ 2011-05-25 19:24 MK2 阅读(2778) 评论(2) 推荐(0) 编辑
摘要: 问题: nodejs目前无法处理非utf8编码以外的字符 在cnodejs用户组,有同学遇到抓取百度页面出现编码问题 由于Buffer.toString(encoding)中encoding只支持utf8编码,所以需要附加模块才能处理此问题 解决:node-iconv 模块 安装: $ npm install iconv 示例 var http = require('http')... 阅读全文
posted @ 2011-05-15 21:31 MK2 阅读(13665) 评论(5) 推荐(0) 编辑
摘要: Google Go boldly goes where no code has gone before 文章中说到与Nodejs的对比: The New Node? Node.js shows great numbers for heavy numbers of clients, and they've done a really good job. But if those clients ar... 阅读全文
posted @ 2011-05-13 21:01 MK2 阅读(442) 评论(0) 推荐(0) 编辑
摘要: 为什么要这样做呢? 无需让用户下载图片后再通过 input file 上传; chrome插件可以直接右键点击页面上的图片,直接上传图片; 都是为了增加用户体验! 思路 通过ajax请求图片,得到图片的二进制数据 组合Uint8Array和BlobBuilder,得到图片的blob对象 增加fileName和fileType,伪装成File对象 实现代码 /** * 将符合字节流的string转化... 阅读全文
posted @ 2011-05-08 22:11 MK2 阅读(15517) 评论(2) 推荐(1) 编辑
摘要: 本文收集一周来业界关于nodejs的相关动态信息和新闻摘要,并会推荐一下非常棒的node.js模块。 Mozilla jumps into Node.js server project Mozilla也对Node.js感兴趣了,已经着手为Node.js提供V8以外的另一个引擎: SpiderNode: This JavaScript engine in Firefox is called Spid... 阅读全文
posted @ 2011-04-29 13:06 MK2 阅读(962) 评论(0) 推荐(0) 编辑
摘要: 浏览器版可直接查看: JavaScript template language shootoff 运行性能测试 测试代码在:https://github.com/fengmk2/mk2blog/tree/master/2011/4/js-template-benchmarks $ node benchmarks.js 我的测试环境 CPU: 4核 Intel(R) Core(TM) i3 CPU ... 阅读全文
posted @ 2011-04-28 17:03 MK2 阅读(5738) 评论(0) 推荐(0) 编辑
摘要: 本文假设你已经使用过doT和express,并知道它的模板语法。 js的模板引擎实在太多了,幸好 JavaScript template language shootoff 这篇不断被更新的文章,帮我们用真实的测试结果,得到了目前最快的模板引擎doT 安装dot $ sudo npm install dot 让express使用dot 安装express的模板引擎约定,引擎必须有一个compile... 阅读全文
posted @ 2011-04-27 22:57 MK2 阅读(1562) 评论(1) 推荐(0) 编辑
摘要: 不能不说,github才是真正的程序员SNS。 n2Mvc n2Mvc: a simple mvc web framework by node.js , mostly like ASP.NET MVC. simplehttp simplehttp: A Very simple HTTP ServerJust Serves files from the current directory and b... 阅读全文
posted @ 2011-04-23 19:03 MK2 阅读(784) 评论(0) 推荐(0) 编辑
摘要: NodeBlog:http://nodeblog.org/ 是一个基于node.js的开源博客程序。 Features Write, Read, List, Search blog. Comments Support image and file upload. DIY template Support nodester.com, no.de... nodejs host services Sim... 阅读全文
posted @ 2011-04-23 18:33 MK2 阅读(518) 评论(0) 推荐(1) 编辑
摘要: Node on iOS Nathan Rajlich写了篇在iOS上运行Node的文章: NodeJS on iOS. 他建立了一个项目 node-iOS,为了让iOS原生支持Node. 你的手机必须先越狱。 Native Windows Support on v0.6.0 让更多windows开发者加入Nodejs,原生支持node是必须的! 详细请看PPT: http://nodejs.org... 阅读全文
posted @ 2011-04-23 18:00 MK2 阅读(708) 评论(0) 推荐(0) 编辑
摘要: git submodule add 添加项目的依赖模块在项目的根目录添加子模块$ cd demo_project$ git submodule add git://github.com/felixge/node-mysql.git deps/mysql$ git submodule init$ git submodule update# 提交更改git submodule init and update 就可以直接获取依赖模块了$ git submodule initSubmodule 'deps/connect' (git://github.com/senchalabs/co 阅读全文
posted @ 2011-04-11 18:05 MK2 阅读(14606) 评论(3) 推荐(0) 编辑
摘要: cnodejs.org将于4月16日在北京betacafe举办Nodejs技术交流聚会, 有想了解javascript服务器端开发的同学吗?可以报名参加喔 http://cnodejs.org/blog/?p=634 阅读全文
posted @ 2011-04-11 13:41 MK2 阅读(643) 评论(0) 推荐(1) 编辑
上一页 1 2 3 4 5 6 ··· 14 下一页