程序笔记
刷新当前页:window.location.reload();
当前窗口打开页面:
用window.open("","_self")
或者
window.location.replace("newurl")
限制textarea框字数
function countlen(textarea){
if (textarea.value.length>400){
alert("字符输入已满!");
textarea.value=textarea.value.substring(0,400);
}
只替换第一个<
<script language="javascript">
var str="</SheetItems><ElectricalStatus>";
str=str.replace("<","!");
alert(str);
</script>
替换所有的<
<script language="javascript">
var str="</SheetItems><ElectricalStatus>";
str=str.replace(/\</g,"!");
alert(str);
</script>
去php.ini中修改可上传文件大小
upload_max_filesize = 20
memory_limit = 20
post_max_size = 20
修改后重启服务器~
到php.ini里去改上传最大显示 upload_max_filesize="2M"
针对sql语句连接的有效解决办法:
where 1=1 $sql and 1=1
js实现按钮状态:
$(bname).style.visibility="visible";
$(bname).disabled=false;
文本框属性中添加不可用属性:
disabled="disabled";
字符串截取:
var name = Request.responseText.split("说")[0];
$a2 = Request.responseText.indexOf("g")+1;
$b2 = Request.responseText.indexOf("说");
var name2 = Request.responseText.substring($a2,$b2);
09年最“胸的”女生:选秀选手不满评委当场扔胸罩
http://www.51sdj.com/phpcms/article/2009/0717/article_253.html