最新文章

getAttribute href bug

分类 Ajax, HTML/CSS, Javascript, 经验分享   星期五, 28 八月 2009   moon
看了shirleyxie的关于href的文章后,让我想起了以前我也遇到过的一个问题,实际上,mm的文章中和我所遇到的并不完全是一个问题,但解决的办法是相同的,互为补充吧,下面我总结一下应该如何使用DOM来获取href属性:    1、相对/绝地地址问题   假设,我们有一个链接,<a href="test1.php">test1</a>,浏览器会根据页面当前的URL来使此链接得到一个绝对地址...

ie下href的问题

分类 HTML/CSS, Javascript   星期四, 27 八月 2009   shirley
问题场景:将带中文编码的url经过以下函数进行编码后得到的URL正常,可以正常打开,可通过getAttribute("href")再次得到后,其中的中文就成为乱码。 这种情况,只在Ie内核的浏览器下出现,解决方案,采用getAttribute("href",2)获取;需要说明的是这种方案在opera8下面仍然不行,如果想兼顾到opera8...

使用expect命令的autopass脚本

分类 SHELL, WEB开发   星期四, 27 八月 2009   gooden
autopass.exp代码:  #!/bin/sh set timeout 20 set result 0 set command [lindex $argv 0] set password [lindex $argv 1] set is_yesno 0; set is_expect 0; eval "spawn $command"; expect {       "*yes/no*" {               set is_yesno 1;               set is_expect 1;               send "yes\r";     ...

web caching相关文章

分类 Caching, 性能优化, 经验分享   星期四, 27 八月 2009   moon
Articles on Web Caching Stephen Pierzchala Caching for Performance — NEW! Caching and Compression for Performance Caching for Performance — Stephen Pierzchala Caching for Performance (Presentation) — Stephen Pierzchala Web Caching Sites Squid Proxy Cache Mark Nottingham's Site — Home of the Web Cacheability...

IE的一个bug

分类 Javascript   星期四, 27 八月 2009   gooden
When assigning a new "href" to an Anchor Element, if this Anchor Element has no childNodes except textNodes which contain strings of URI (http://foo) or Email (foo@bar), then the innerHTML of the Anchor Elemen will change to its "href" when a new "href" is applied. 当给<a>标签的href赋值时,如果该标签除了文本外没有其他内容,并且文本中包含http://foo或者Email,那么标签的innerHTML将被href的内容覆盖! 解决方案:方法1:先对href赋值...

ie6下重复加载图片问题

分类 Caching, HTML/CSS, Javascript, 性能优化   星期四, 27 八月 2009   penny
今天遇到这么一个问题,IE6,在window.onload里用innerHTML动态插入图片,结果这些图片都忽略了本地缓存策略,发出N多个304请求。   于是乎我换了一个写法,在innerHTML里不使用img,而是在innerHTML新添加的HTML标签中使用CSS样式来导入图片,但问题依旧,IE6 还是狂发304请求。   在网上搜索到了emu一篇BLOG说innerHTML创建的 img 都会忽略本地缓存...

无条件的delete查询在mysql4.1.2 版之前mysql_affected_rows为0

分类 PHP, 数据库, 经验分享   星期四, 27 八月 2009   moon
$res = mysql_query("delete from tblName");echo $rows = mysql_affected_rows(); 变量$rows在mysql4.1.2 之前,将为0; 可以简单做如下处理: function hack($sql){   if (preg_match('/^\s*DELETE\s+FROM\s+(\S+)\s*$/i', $query)) {   $query = preg_replace('/^\s*DELETE\s+FROM\s+(\S+)\s*$/',   'DELETE FROM \1 WHERE 1=1', $query);   }   return $query; } 加上一个where 1=1(真条件)...

ssh经验

分类 SHELL, WEB开发   星期四, 27 八月 2009   penny
ssh的private key(测试环境不用输入密码) 执行ssh-keygen,会在~/.ssh生成公钥和私钥,如id_rsa和id_rsa.pub 将id_rsa.pub加入到~/.ssh/authorized_keys 将id_rsa和id_rsa.pub发到远程机器上,在SecureCRT中设置ssh session 的PublicKey,linux下用ssh -i id_rsa xxx@1.2.3.4方式登陆 为了安全,在主机上将id_rsa和id_rsa.pub删除 ssh 时不用确认 yes(可使用expect 输入密码...
Page 11 of 11« First...7891011