`
leeyea
  • 浏览: 13451 次
  • 性别: Icon_minigender_2
  • 来自: 杭州
文章分类
社区版块
存档分类
最新评论
文章列表
<pre name="code" class="javascript">function GetBrowserType(){ var u_agent = navigator.userAgent; var browser_name='Failed to identify the browser'; if(u_agent.indexOf('Firefox')>-1){ browser_name='Firefox'; }else if(u_agent.indexOf('Chrome')>-1){ ...
在项目中,我们在处理数据的时候经常需要去重复数据,以便归结或者其它: Array.prototype.distinct = function () { var a = {}, c = [], l = this.length; for (var i = 0; i < l; i++) { var b = this[i]; var d = (typeof b) + b; if (a[d] === undefined) { c.push(b); a[d] = 1; } } return c; } var arr = ["白色&q ...
My97 DatePicker 设置当天日期的前或后不能选中 当天日期后不能选中<input class="Wdate" type="text" onfocus="WdatePicker({skin:'whyGreen',maxDate:'%y-%M-%d'})"/> 当天日期前不能选中<input class="Wdate" type="text" onfocus="WdatePicker({skin:'whyGreen',minDate:'%y-%M-%d'} ...
今天在项目中发现,当插入或读取JSON数据时遇见回车符,返回JSON数据格式时会报错(firebug里体现为乱码),百度了一下发现JSON不支持字符串里存在回车! 解决办法: 在向接口插入带json格式的数据之前,将回车等特殊符合替换成json接受的符号; 在向接口请求读取json格式的数据时,将回车等特殊符合替换成json接受的符号; 发送到后台 myPostStr.replace(/[\r\n]/g,"|"); //将myStr字符串里的回车和换行符替换成"|" ( 经测试json支持这个特殊字符 ) 读取到前台 GetJso ...
相信熟悉csdn的phper在发布文章的时候,都体验过其人性化的功能! js功能源代码:http://csdnimg.cn/pig/blog/write/scripts/postedit.js?v=1.111 主要人性化功能: 1、定时保存文章为草稿 2、页面跳转前给用户确认提示
$("#AccountNum").keydown(function(e) { if(!isNaN(this.value.replace(/[ ]/g,""))){ this.value =this.value.replace(/\s/g,'').replace(/(\d{4})(?=\d)/g,"$1 ");//四位数字一组,以空格分割 }else{ if(e.keyCode==8){//当输入非法字符时,禁止除退格键以外的按键输入 return true; ...
var arr = new Array(6) arr[0] = "George" arr[1] = "John" arr[2] = "Thomas" arr[3] = "James" arr[4] = "Adrew" arr[5] = "Martin" document.write(arr + "<br />") document.write(arr.sort()) 运行结果: George,John,Thomas,James,Adre ...
域名解析: 相信不少的站长就域名解析都遇到了难题,通过这张表图就明白域名解析啦! ICP备案(不同的ICP服务商的备案流程可能略有不同): 备案核验照片拍照方式(任选其中一种) 1、前往授权核验点拍照
//json var jsonDate= [{ name:"leeyea", sex:"man", age:"28" },{ name:"leeyea2", sex:"female", age:"25" }] //echo json $(function(){ //jsonDate[0].name='mary';//改变json中指定的值 for(i=0; i<jsonDate.length; i++){ $name=&q ...
最近一个项目,在本地php环境里一切正常,ftp上传到虚拟空间后,当执行更新操作(我的目的是为了设置id为空)set id=‘’时提示: Incorrect integer value: '' for column 'id' at row 1 解决办法: 方法1、程序端(针对无法修改mysql配置的用户,如虚拟主机、空间等) 将set id=''改成set id=NULL,如果是条件:"...where 字段名 is NULL" 方法2、修改mysql配置文件(比如在本地环境做项目) 查找mysql里的my.ini配置文件,找到sql-mode,将 sql-mo ...
IE6/IE7运行提示:“缺少标识符 字符串或数字决”,原因及解决办法: jq的属性操作:attr方法间的多个属性必须用逗号隔开,如: $(node).attr({ width:"", height:"", src:"" })但是最后一个属性src后面不能有逗号!否则在ie6、ie7下均会报错,尽管chrome、firefox等不报错。
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset= ...
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> <script type="text/javascript"> var timer function scrolltop() { document.getElementById('scrollmenu') ...
<?php header('Content-Type:text/html;charset=utf-8');//编码设置 /* *Powered by leeyea *2011-11-16 大概步骤: 一、建立数据库news_db news表字段:id、title、content、path(HTML文件路径) 二、提交数据的表单页面add.html 表单action到add.php 三、创建一个HTML模版model.html <html> <body> 新闻的标题:{title} 新闻的内容:{content} ...
创建数组(使用 array() 语言结构创建数组) 1、索引数组 indexed array:键名为数字 ID 的数组 $arrayAge1=array([0]=>26,[1]=>17,[2]=>35); echo $arrayAge1[0];//输出26 2、关联数组associative array:用字符串而非数字索引作为键名 $arrayAge1=array("leeyea"=>26,"zhang"=>17,"wang"=>35); echo $arrayAge1[leeyea]; ...
Global site tag (gtag.js) - Google Analytics