用正则表达式手段匹配尖括号内部
使用php手段删除包括尖括号在内的所有字段
$s = 'asdfs<fadfjhasf>';
echo preg_replace('/<[^>]*>/', '', $s);
echo preg_replace('/<[^>]*>/', '', $s);
使用php手段删除包括尖括号在内的所有字段
<?
$tes = "1212312312312312<scriptasda>";
echo $tes;
echo "-----------<br>";
echo strip_tags($tes);
?>
$tes = "1212312312312312<scriptasda>";
echo $tes;
echo "-----------<br>";
echo strip_tags($tes);
?>
Written on 2008/07/18 by yaiba - Reads: 145 Comments: 0
之前站点的consume中显示显示统计值一直都是调用php-pear的image_graph包实现的,那个东西文档稀缺而且对服务器要求较高,效果又不尽人意。前几天在csdn闲逛,发现一用css写的柱状图,觉得很不错,于是将现有生成图的那部分重新写了一下,效果还不错~
在网上抓的那段原始代码如下,很简单,想到做到:
css部分
在网上抓的那段原始代码如下,很简单,想到做到:
css部分
<style type="text/css">
* {margin:0; padding:0;}
body {padding:0;margin:40px;font-size:9pt;font-family:Helvetica,Geneva,sans-serif;}
table#q-graph {
width:600px;
height:300px;
caption-side:top;
border:2px solid #0063be;
background:#adfe12 url(http://www.dudo.org/attach... repeat-x scroll 0 0 !important;
background:#adfe12 repeat-x scroll 0 0;
position:relative;
display:block;
}
table#q-graph caption {
width:100%;
position:absolute;
top:-20px;
}
* {margin:0; padding:0;}
body {padding:0;margin:40px;font-size:9pt;font-family:Helvetica,Geneva,sans-serif;}
table#q-graph {
width:600px;
height:300px;
caption-side:top;
border:2px solid #0063be;
background:#adfe12 url(http://www.dudo.org/attach... repeat-x scroll 0 0 !important;
background:#adfe12 repeat-x scroll 0 0;
position:relative;
display:block;
}
table#q-graph caption {
width:100%;
position:absolute;
top:-20px;
}
Written on 2008/06/26 by yaiba - Reads: 158 Comments: 0
昨天美工在那弄js的漂浮,唠唠叨叨的,后来我决定帮他看看。记得javascript漂浮的代码满网都是,于是顺手去网上摘了几段回来用了,可是没想到哦那个嫁接出来的代码居然不支持W3C标准,有的方法居然无法侦测到浏览器的下边缘坐标,漂浮代码失效的原因如下:
在使用以下声明时,会使一个最常用的漂浮下拉广告失效。
直接导致document.body.scrollTop永远等于0,body Scroll永远也不会引发。
所以我把document.body用document.documentElement替换掉,结果就好用了。
在使用以下声明时,会使一个最常用的漂浮下拉广告失效。
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml...
<html xmlns="http://www.w3.org/1999/xht...
<html xmlns="http://www.w3.org/1999/xht...
直接导致document.body.scrollTop永远等于0,body Scroll永远也不会引发。
所以我把document.body用document.documentElement替换掉,结果就好用了。
Written on 2008/06/17 by yaiba - Reads: 340 Comments: 0
Written on 2008/03/13 by yaiba - Reads: 529 Comments: 0
最近一项目要求在网站页面的两侧显示浮动广告,也就是现在被各大站长广泛适用的js对联广告,本着“写一个不如找一个改”的原则,I Google It And Edit It,最终版本带有如下特性:
1.广告位置始终浮动在页面两侧且虽页面宽度自动调整、
2.在1024*768分辨率下正常显示、
3.在800*600的分辨率下可以自动隐藏、
4.允许访客点击关闭广告图片。
1.广告位置始终浮动在页面两侧且虽页面宽度自动调整、
2.在1024*768分辨率下正常显示、
3.在800*600的分辨率下可以自动隐藏、
4.允许访客点击关闭广告图片。
Written on 2008/01/23 by yaiba - Reads: 756 Comments: 0
JavaScript实现页面跳转的几种方式
第一种:
第一种:
<script language="javascript" type="text/javascript">
window.location.href="login.jsp?backurl="+window.location.href;
</script>
window.location.href="login.jsp?backurl="+window.location.href;
</script>
Written on 2007/12/11 by yaiba - Reads: 730 Comments: 0
这两天做程序,发现js老是出错,明明ie7和Firefox中没有任何错误,在ie6就提示错误“未结束的字符串常量”,最后请教了Google,才知道是编码不统一的问题,可能是引用了与页面编码格式不同的js文件,或者是页面中包含了编码不同的代码,如汉字或者其它字符。经过排查,发现是页面的编码不统一,将设置页面编码格式语句:
从body上面调放至js代码之前,这样就解决了这个莫名奇怪的问题。
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
从body上面调放至js代码之前,这样就解决了这个莫名奇怪的问题。
Written on 2007/12/02 by yaiba - Reads: 1727 Comments: 1





