使用jquery实现ajax无刷新上传是个老话题了, 网上也有很多针对jquery发布的插件, 下载了几个试用了试用, 推荐一下这个
Ajax Upload,方便快捷. 把原文简单的翻译了一下, 希望能对这方面感兴趣的朋友有所帮助.
使用方法:
建立uploader
使用如下语句建立上传按钮.
<div id="upload_button">Upload</div>
建立Ajax Uploader实例
使用如下代码
// You must create it only after the DOM is ready for manipulations
// Use $(document).ready for jquery
// document.observe("dom:loaded" for prototype
new AjaxUpload('upload_button_id', {action: 'upload.php'});
// 注: 如果我们使用的jquery框架, 我们可以这样加载Uploader
$(function(){
new AjaxUpload('upload_button_id', {action: 'upload.php'});
})
阅读全文…
admin Javascript jquery
我很喜欢的一位德国女歌手, 更多的资料你可以看这里
from sarah with love
for so many years we were friends
and yes i always knew what we could do
but so many tears in the rain
felt the night you said
that love had come to you
i thought you were not my kind
i thought that i could never feel for you
the passion and love you were feeling
and so you left
for someone new
and now that youre far and away
im sending a letter today
from sarah with love
shed got the lover she is dreaming of
she never found the words to say
but i know that today
shes gonna send her letter to you
from sarah with love
she took your picture to the stars above
and they told her it is true
she could dare to fall in love with you
so dont make her blue when she writes to you
from sarah with love
阅读全文…
admin 音乐
打开电脑, 点击开始->运行 输入如下
telnet towel.blinkenlights.nl
电影开始了…

admin 生活
1) MPM的选择与配置
MPM的引入是Apache 2.0最重要的变化。大家知道,Apache是基于模块化的设计,而Apache 2.0更扩展了模块化设计到Web服务器的最基本功能。服务器装载了一种多道处理模块,负责绑定本机网络端口、接受请求,并调度子进程来处理请求。
我们可以通过–with-mpm=MPM来指定MPM模块,
$./configure –help | grep mpm
结果:–with-mpm=MPM
Choose the process model for Apache to use.
MPM={beos|worker|prefork|mpmt_os2| perchild|leader|threadpool}
如果不用“–with-mpm”显式指定某种MPM,prefork就是Unix平台上缺省的MPM。它所采用的预派生子进程方式也是 Apache 1.3中采用的模式。prefork本身并没有使用到线程,2.0版使用它是为了与1.3版保持兼容性;另一方面,prefork用单独的子进程来处理不同的请求,进程之间是彼此独立的,这也使其成为最稳定的MPM之一。
make, make install完成之后, 打开httpd.conf, 修改下面
<IfModule prefork.c>
StartServers 5
MinSpareServers 5
MaxSpareServers 10
MaxClients 150
MaxRequestsPerChild 0
</IfModule>
其中的MaxClients 150改为
ServerLimit 2000
MaxClients 1000
MaxRequestsPerChild 10000
对于大多数站点已经足够了.
2) 运用mod_deflate模块来提升网页的浏览速度
关于mod_deflate的详细文档, 请参考官方文档
在configure apache2时候加入选项–enable-deflate=shared, 即可完成deflate模块的支持.
在httpd.conf里加入deflate模块的支持
LoadModule deflate_module modules/mod_deflate.so
<IfModule mod_deflate.c>
DeflateCompressionLevel 7
AddOutputFilterByType DEFLATE text/html text/plain text/xml application/
x-httpd-php
AddOutputFilter DEFLATE js css
</IfModule>
压缩级别可以选择最大压缩率9, 不过需要占用更多的CPU.
admin Linux
自从改到.NET之后, PHP也忘记了, Linux也忘记了, SIGH, 前几天一个朋友的Linux的机器崩溃了, 可能是非正常退出, 然后进入不了系统, 让机房的技术支持fsck了一下之后, 应该没问题了, 谁知道他可能是直接按电源重启了, 然后就进入到了grub>的界面了,没办法了, 我去了一趟机房, 觉得从grub命令行启动一下应该没问题. 这里顺带说一下使用grub引导linux系统的过程.
阅读全文…
admin Linux
经典老歌了. 偶尔重温.
oh you get me ready in your 56 chevy
why don’t we go sit down in the shade?
take shelter on my front porch
the dandelion sun scorched,
would you like a glass of cold lemonade?
i will do the laundry if you pay all the bills.
where is my john wayne?
where is my prairie son?
where is my happy ending?
where have all the cowboys gone?
阅读全文…
admin 音乐
Recent Comments