2011年10月6日
摘要: 1、js文件编码utf-8无bom编码2、服务端脚本程序入口 (main())http.createServer(function(req, res) { var handler = UrlMap[url.parse(req.url).pathname] || notFound; handler(req, res); }).listen(8080);3、UrlMap,保存请求的路径和对应的处理,通过setUrlMap来设置var UrlMap = {};setUrlMap = function (path, handler) { UrlMap[path] = handler;};4、not.. 阅读全文
posted @ 2011-10-06 22:23 rain.j 阅读(261) 评论(0) 推荐(0) 编辑
  2009年10月15日
摘要: 调用格式:template.render(path, template_values)以下内容摘自:http://www.djangoproject.com/documentation/0.96/templates/The Django template language: For template authorsThis document describes Django version 0.9... 阅读全文
posted @ 2009-10-15 16:56 rain.j 阅读(482) 评论(0) 推荐(0) 编辑
摘要: Goolge提供很多的例程,挑选了simple-ajax-chat,不为别的就因为一看名字就知道大概要做点什么,其他的一些基本不知道做什么用。 代码位置:http://code.google.com/p/google-app-engine-samples/source/browse/trunk/simple-ajax-chat 代码不多,只有188行(如下): 1 import cgi 2 im... 阅读全文
posted @ 2009-10-15 16:36 rain.j 阅读(554) 评论(0) 推荐(1) 编辑
  2009年10月14日
摘要: 按照Google的帮助说明测试helloworld,发现错误"NameError: global name 'execfile' is not defined",再看自己的python版本是3.1,查了下Python的更新,发现从3.0开始,'execfile'已经被取消了,虽然也可以使用exec替代,但考虑到和App Engine的兼容(google说明需要2.5)还是装回了2.6。问题解决! 阅读全文
posted @ 2009-10-14 11:09 rain.j 阅读(2035) 评论(0) 推荐(0) 编辑
  2009年10月13日
摘要: 最重要的当让是先记下东家的地址:http://code.google.com/intl/zh-CN/appengine/docs/whatisgoogleappengine.html万里长征第一步也从这里开始。。。。。 阅读全文
posted @ 2009-10-13 17:09 rain.j 阅读(328) 评论(0) 推荐(0) 编辑