2012年4月7日星期六

jquery html() ie8下问题

ie8下   jquery html()
$("#id").html(content)如果content内容不规范;
content内容不会被添加进id内
显示会有问题。

2012年3月15日星期四

批处理文件,执行多个命令

start /d "路径" 可执行程序  参数

2012年3月8日星期四

pylons学习(续)

学习Pylons的示例,最好用英文目录下测试,中文目录下很多编码问题,
目前还没找到好的办法解决中文目录造成的模板显示问题。

1,response ,request用法
2,Pylons提供了多种调试问题的方式,
网页调试
3,mako  Template技术
各种技术都大体类似
Mako语法的注释
<%doc></%doc>
##
输出文本语法
<%text></%text>
%  后面可以跟可执行的python命名
<%    %>中间是代码段
<%!     %>   module级的代码块,里面的内容只被执行一次


Mako模板调试
wingware提供了一种方式,蛮好用的,分享一下
To avoid this, do not specify the --reload flag for Paste. Place the following in a file that you add to your project and set as the main debug file:

from paste.script.serve import ServeCommand
ServeCommand("serve").run(["development.ini"])

This may vary somewhat, as necessary for your application.

http://wingware.com/doc/howtos/paste-pylons

pylons安装

pylons安装
1,安装python2.7
2,配置path环境,可以直接在命令行上使用python.exe
3,安装easy_install
python  ***ez_setup.py(从pypi网站下载)
并添加easy_install.exe所在目录到path环境
4,安装Pylons
easy_install Pylons
更新
easy_install -U Pylons
5,创建示例
paster create -t pylons HelloWorld

6,启动
paster server --reload development.ini

--reload,当文件改变时,自动重启服务

7,paster controller 建立controller
paster controller Hello
controller中可以使用的request,response变量

8,route文件配置,
config/route.py