php 解UNICODE编码

星期三, 八月 4th, 2010 Posted in PHP开发 | No Comments »

php解UNICODE编码实例

Tags: ,

PHP n个不重复的随机数生成代码

星期三, 八月 4th, 2010 Posted in PHP开发 | No Comments »

PHP n个不重复的随机数生成代码,原理就是将数组顺序随即打乱 ,然取该数组中的某一段

复 制代码 代码如下:
<?php
//range 是将1到100 列成一个数组
$numbers = range (1,100);
//shuffle 将数组顺序随即打乱
shuffle ($numbers);
//array_slice 取该数组中的某一段
$no=6;
$result = array_slice($numbers,0,$no);
for ($i=0;$i<$no;$i++){
echo $result[$i].”<br>”;
}
print_r($result);
?>

Tags: ,

window.open()–窗口参数详解!

星期三, 八月 4th, 2010 Posted in JavaScript | No Comments »

window.open()–窗口参数详解!
window.open()方法中,窗口控制参数的详细定义:
alwaysLowered innerWidth screenY
alwaysRaised left scrollbars
channelmode location status
dependent menubar titlebar
directories outerWidth toolbar

Tags: ,

HTML注释标签在IE6中会造成DIV内文字溢出的BUG,以及解决办法

星期三, 八月 4th, 2010 Posted in xhtml/html | No Comments »

解决办法,在最后溢出的下面增加新的<div>,

属性为<div style=”display:none;”></div>

让div充当溢出的部分,然后由于其隐藏属性,使溢出也隐 藏。

(= =||| 貌似发现上面写了几行<!– –>的注释,下面就要写几行隐藏div,郁闷….)

Tags: , ,

JavaScript CSS Style 属性对照表

星期三, 八月 4th, 2010 Posted in css, JavaScript | No Comments »

[第一个参数为CSS里的写法,第二个参数为javascript里的写法]

盒子标签和属性对照
CSS语法 (不区分大小写) JavaScript语法 (区分大小写)
border border
border-bottom borderBottom
border-bottom-color borderBottomColor
border-bottom-style borderBottomStyle
border-bottom-width borderBottomWidth

Tags: , ,

清空File类型input的值

星期二, 八月 3rd, 2010 Posted in JavaScript | No Comments »

忘记是从哪里找的了

//清空File类型input的值
function clearFileInput(file){
    var form=document.createElement('form');
    document.body.appendChild(form);
    var pos = file.nextSibling;
    form.appendChild(file);
    form.reset();
    pos.parentNode.insertBefore(file, pos);
    document.body.removeChild(form);
}

Tags: ,

Page 6 of 6123456