简单东西。自己看着玩

1、连接调用JS
<a href="#" οnclick="del();">删除</a></td>
2、按纽跳转action
<input type="button" name="ss" value="1111111" οnclick="javascript:location='inner.do'" >
3、提交当前Form
<button οnclick="document.forms.queryform.submit();""> 保 存</button> 
4、单独提交action
<button οnclick="javascript:location='../project/build/outer.do'"> 发起下达审批</button>
5、js提交action
function edit(opid,cid)
{
document.ff.action= "basClassDetail.do?action=edit&opid="+opid+"&cid="+cid;
document.ff.submit();
}
6.div控制显示
style="display:block"
or
style="display:none"
7 <input type="submit" class="submitButton" value="确定" style="margin-right:60px"/>
8、下拉列表控制显示
function disvalue()
{ var a=document.getElementById("dotype").value;
if(a==1){
document.all('tab2').style.display='block';
document.all('tab1').style.display='none';
}
else{
document.all('tab1').style.display='block';
document.all('tab2').style.display='none';
}
}
9.在SQL/PLUS工具中运行如下可以得到服务名
select global_name from global_name;

10、确定删除用法
<a href="DocumentMain.do?action=delete&docid=1943&dirname=????????"
οnclick="return confirm('确定删除该文档?','')">删除</a>
11、一个按纽显示隐藏
<script type="text/javascript">
function updateCategory(btn){
if(btn.value=='隐藏'){
document.getElementById("categorys").style.display="none";
btn.value='显示'; }
else if(btn.value=='显示'){
document.getElementById("categorys").style.display="block";
btn.value='隐藏'; }
}
<input class="clickButton" type="Button" οnclick="updateCategory(this)" value="显示"/>


</script>
12定义一个list
<s:select name="search_status" list="#{'all':'所有','1':'有效','0':'无效'}" />

13页面中有两个日期,限制结束日期不小于开始日期的方法
<input id="beginDate" type="text" name="applyTime" class="Wdate" onClick="new WdatePicker()" readonly />
<input id="endDate" type="text" name="applyTime" class="Wdate" onFocus="WdatePicker({minDate:'#F{$dp.$D(\'beginDate\')}'})" readonly />


14 时间计算
private void Datedat(Date date1) throws ParseException{
//新建一个日期格式化类的对象,该对象可以按照指定模板格式化字符串
SimpleDateFormat f=new SimpleDateFormat();
//新建一个日期对象,日期的值来源于字符串,由f将这个字符串格式化成为日期
//新建一个日历对象。注意:类Calendar是抽象的要使用getInstance()实例化,或者实例化其子类
Calendar calen = Calendar.getInstance();
//日历对象默认的日期为当前日期,调用setTime设置该日历对象的日期为程序中指定的日期
calen.setTime(date1);
//将日历的"天"增加5
calen.add(Calendar.DAY_OF_YEAR,5);
//获取日历对象的时间,并赋给日期对象c
Date c=calen.getTime();
//用f格式化c并输出
System.out.println(f.format(c));

}
15、怎样才让在showModalDialog和showModelessDialog的超连接不弹出新窗口?
  在被打开的网页里加上<base target="_self">就可以了。这句话一般是放在<html>和<body>之间的

16.list的排序
public void ss() throws Exception{
List list = new ArrayList();
Set set = new HashSet();
set.addAll(list);//将list添加到set中
list.clear();//清除list中的数据
list.addAll(set);//将set中的数据重新写回list中

}
17、break
  break语句
  break语句通常用在循环语句和开关语句中。当break用于开关语句switch中
  时, 可使程序跳出switch而执行switch以后的语句; 如果没有break语句, 则将
  成为一个死循环而无法退出。break在switch 中的用法已在前面介绍开关语句时
  的例子中碰到, 这里不再举例。
  当break语句用于do-while、for、while循环语句中时, 可使程序终止循环
  而执行循环后面的语句, 通常break语句总是与if语句联在一起。 即满足条件时
  便跳出循环。
  例:
  main()
  {
  int i=0;
  char c;
  while(1) /*设置循环*/
  {
  c='\0'; /*变量赋初值*/
  while(c!=13&&c!=27) /*键盘接收字符直到按回车或Esc键*/
  {
  c=getch();
  printf("%c\n", c);
  }
  if(c==27)
  break; /*判断若按Esc键则退出循环*/
  i++;
  printf("The No. is %d\n", i);
  }
  printf("The end");
  }
  注意:
  1. break语句对if-else的条件语句不起作用。
  2. 在多层循环中, 一个break语句只向外跳一层。


18.备份数据库 exp cmsadmin/cmsadmin file=cms.dmp log=cms.log
导入数据库 imp cmsadmin/cmsadmin file=cms.dmp log=cms.log full=y
19、限制输入数字οnkeyup="value=value.replace(/[^\d]/g,'')"

20、 cd D:\svn-win32-1.6.1\bin
svnserve.exe --daemon

21、java过滤特殊字符
public static String StringFilter(String str) throws PatternSyntaxException {
// 只允许字母和数字
// String regEx = "[^a-zA-Z0-9]";
// 清除掉所有特殊字符
String regEx="[`~!@#$%^&*()+=|{}':;',\\[\\].<>/?~!@#¥%……&*()——+|{}【】‘;:”“’。,、?]";
Pattern p = Pattern.compile(regEx);
Matcher m = p.matcher(str);
return m.replaceAll("").trim();
}
22、sql中去特殊字符
update bas_dptlist set dptname =replace(dptname,'-','')
23

<input class="clickButton" type="submit" οnclick="if(window.opener!=null) window.opener.location.reload();window.close();"
name="returnbackButton" value="dd" />
24、
对于table做循环,来改变背景颜色
function changecolor(){

var objTable = document.getElementById("ec_table");
for(var i= 2;i<objTable.rows.length-1;i++){
var input = objTable.rows(i).cells(0).all(0);
if(input.value==8){
objTable.rows(i).style.backgroundColor="red";
}
}
// load();
}


24、校验输入的是否是数字:
οnkeyup="value=value.replace(/[^\d]/g,'')"


25、返回上一页面
1. history.go(-1), 返回两个页面: history.go(-2);
2. history.back().

3. window.history.forward()返回下一页

4. window.history.go(返回第几页,也可以使用访问过的URL)

例:

<a href="javascript:history.go(-1);">向上一页</a>

response.Write("<script language=javascript>")
response.Write("if(!confirm('完成任务?')){history.back();}")
response.Write("</script>")
response.Write("<script language=javascript>history.go(-1);</script>")
<a href="javascript:history.go(-1);">向上一页</a>
页面跳转:οnclick="window.location.href='list.aspx'"

P.S.
小技巧(JS引用JS):

<script type=text/javascript>
<!--
if (typeof SWFObject == "undefined") {
document.write('<scr' + 'ipt type="text/javascript" src="/scripts/swfobject-1.5.js"></scr' + 'ipt>');}
//-->
</script>
<a href="javascript:history.back()">返回</a>;
或者window.location=history.go(-1); 试试

25.字符集问题
java.net.URLDecoder.decode(name, "UTF-8");

26 取当前class的路径。。编译路径
public class FileTest {
public static void main(String[] args) {
System.out.println(Thread.currentThread().getContextClassLoader().getResource(""));
System.out.println(FileTest.class.getClassLoader().getResource(""));
System.out.println(ClassLoader.getSystemResource(""));
System.out.println(FileTest.class.getResource(""));
System.out.println(FileTest.class.getResource("/"));//Class文件所在路径 
\.out.println(newFile("/").getAbsolutePath());
System.out.println(System.getProperty("user.dir"));
}
}


27、tomcat编码设置
URIEncoding="UTF-8"

28、flex 调用页面 刷新
ExternalInterface.call("function(){location.reload();}");

29、flex手形鼠标
<mx:Label text="click me"
useHandCursor="true"
buttonMode="true"
mouseChildren="false"/>
30。 oralce导入导出语句
imp username/password@db_name file=d:\filename.dmp fromuser=user1 touser=user2
exp username/password@db_name file=d:\xxxxx
imp fszg/fszg@test file=h:\zz.dmp log=zz.log commit=y full=y grants=n ignore=y
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值