导航

2012年11月28日

摘要: #!/bin/bashexport PATH="$PATH":/usr/local/binfilepre="/data1/www/htdocs/xxx.xxx.xxx/system/"filename=("sendbadge.php" "sendcache.php" "sendmail.php" "sendnotice.php" "sendweibo.php")logname=("testsendbadge.log" "tes 阅读全文

posted @ 2012-11-28 16:48 surealland 阅读(113) 评论(0) 推荐(0) 编辑

摘要: — http://blog.fallseir.com/2008/10/array_in_shell/$arr=(1233435)$echo$arr//默认获取第一个元素>123$echo${arr[1]}//通过下标访问>34$echo${arr[@]}//访问整个数组,@或者*获取整个数组>1233435$echo${#arr[@]}//获取数组的长度(最大下标),#获取长度数组中是最后一个下标>3$echo${#arr[3]}//获取字符串长度>1$echo${arr[@]:1:2}//切片方式获取一部分数组内容>343$echo${arr[@]:2}/ 阅读全文

posted @ 2012-11-28 16:39 surealland 阅读(153) 评论(0) 推荐(0) 编辑

2012年9月19日

摘要: 页面无刷新修改url.便于ajax页面定位。window.location.href;//"http://www.cnblogs.com/surealland/admin/EditPosts.aspx?opt=1";window.location.hash='#test';window.location.href;//"http://www.cnblogs.com/surealland/admin/EditPosts.aspx?opt=1#test"场景:例如页面加载时,判断window.location.hash定位到上次浏览的位置。( 阅读全文

posted @ 2012-09-19 16:36 surealland 阅读(630) 评论(0) 推荐(0) 编辑

摘要: //基本用法function A(){ this.name='A'; this.func=function(x,y){ console.log(this.name,x+y); }}function B(){ this.name='B';}var a=new A();var b=new B();//b调用a的func.a.func.call(b,5,6);//B 11a.func.apply(b,[5,6]);//B 11//升级用法 B“继承”Afunction A(name){ this.a='a'; this.name=na... 阅读全文

posted @ 2012-09-19 16:11 surealland 阅读(134) 评论(0) 推荐(0) 编辑

2012年7月11日

摘要: 写个例子一目了然。var testWith={ name:'tom', action:function(){ alert('tom,tom');}};with(testWith){ alert(name); action();} 阅读全文

posted @ 2012-07-11 15:03 surealland 阅读(101) 评论(0) 推荐(0) 编辑

2012年6月16日

摘要: 关于js跨域问题,目前只用过的有两种方法,总结一下:为了说的明白点,写个例子:本域:http:www.a.com外域:http:www.b.com 请求的外域文件:http://www.b.com/f.php?key=a&test=justfortest方法1:jsonp。json基本原理:通过在html文件中添加script标签,设置标签的src属性值为其他域的server文件地址,返回的数据通过jsonp模式获取。jsonp模式是:js请求server时,传入一个函数名funca,服务端返回json数据时,用funca包含json。funca(json)。js文件中定义funca为 阅读全文

posted @ 2012-06-16 15:53 surealland 阅读(341) 评论(0) 推荐(0) 编辑

2012年4月9日

摘要: 1、xhtml要求标签嵌套正确。<div><p></p></div>2、xhtml要求标签必须闭合。<p></p>3、xhtml要求标签名小写。<p></p>4、xhtml要求文档必须有根节点。<html></html>总的来说就是比html更严格。类似html的xml。现在一般都用<!DOCTYPE htmlPUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN""http://www.w3.org/ 阅读全文

posted @ 2012-04-09 15:19 surealland 阅读(79) 评论(0) 推荐(0) 编辑