小知识渗透贴(回忆过去知识贴)

   回味了下以前学习的。有会的,有生疏的。还有基本上忘得。。

   通过,回顾旧的知识,感觉自己确实又增进不少~!此贴设置成回忆过去知识的集合贴得了!

          

                                                      知识回顾集合贴

  需要注意的一些:

  checkLogin=checkLogin+(char)(Math.Random()*('z'-'a'+1)+'a');

 ------------------------------------------------------------------------------------

 if (window.confirm("确定删除该相册吗?")){
  alert("删除成功");
  }//javascript自带的确定/取消 和谐命令~!

-----------------------------------------------------------------------------------

  p {cursor:pointer;} 这个实在css中设置当你把鼠标移到段落时,鼠标变成小手

 

----------------------------------------------------------------------------------

 

java数组声明详解 1.只声明

int [ ]   n ;

可以之后在创建 ( n = new int [5] ;   )

但是不能再初始化了 ( n = {2,1,5,4,5} ;     错误)

2.声明,创建( 分配内存 )

int [ ]   n = new int [5] ;

3.声明,创建,初始化

int [ ]   n = {2,1,5,4,5} ;

4.多维数组

4.1    矩形数组

//方式一(当然声明和创建可以分开)
int [ ][ ] n = new int [2][3];

//方式二    int [ ][ ] n = {{1,2,3},{4,5,6}};
4.2    锯齿数组

    //方式一(当然声明和创建也可以分开)   int [ ][ ] n = new int [2][ ];
n [0] = new int [3];
n [1] = new int [5];    //方式二   int [ ][ ] n = {{1,2,3},{4,5,6,7,8}};
注:在 new 多维数组时,如果有某一个 [ ] 内有数字,即定义了该维的长度,则该 [ ] 之前的所有 [ ] 内都必须有数字。

//错误定义一(两种方式都是错误的)
int m[ ] = new int[ ];
int n[ ][ ] = new int[ ][ ];

//错误定义二(两种方式都是错误的)
int m[ ][ ] = new int[ ][3];
int n[ ][ ][ ] = new int[ ][3][ ];

//正确定义
int n[ ] = new int[3];
int n[ ][ ] = new int[3][ ];
int n[ ][ ] = new int[3][5];
int n[ ][ ][ ] = new int[3][ ][ ];
int n[ ][ ][ ] = new int[3][5][ ];
int n[ ][ ][ ] = new int[3][4][5];

 ----------------------------------------------

<html:form action="完整类名"/> //这个action 的请求对应了struts-config.xml中的form-bean,那么下面直

接用一属性就可以了
<html:text property="ename"/>  这样就能显示对应得form-bean中的ename属性

 

 

html标签用于一个对应得form-bean

若是多个form组成的list,那么可以用c标签

--------------------------------------------------------------------------------------

 

用html标签做时,应该注意,在action中将request.setAttribute("empForm",empform);

empForm要与struts-config.xml 中配置的

 <form-bean name="empForm" type="com.actionForm.empActionForm"></form-bean>

name="empForm"保持一致,否则是会报错的。

-----------------------------------------------------------------------------------------------------------------------------------------------

<script type="text/javascript" src="dwr/interface/DAO.js"/> 这样写是错误的! / 不应该放那,平时没有注意过!

正确的写法:<script type="text/javascript" src="dwr/interface/DAO.js"></script>

-----------------------------------------------------------------------------------------------------------------------------------------------

重复按时间调用方法:

setInterval("方法名",时间);

 

<script type="text/javascript">
  function tt(){
  alert(11);
  }
  setInterval("tt()",2000);
  </script>

 

每隔2秒钟打印出11

----------------------------------------------------------------------------------------------------------------------------------------------

js动态添加table

 

 

<body>

<table border="1" cellpadding="20px" >

 <div align="right"><input type="button" value="添加" οnclick="openAddPage()"/> </div>
      <tr><td>编号</td><td>姓名</td><td>性别</td><td>年龄</td><td>email</td>
      </tr>
      <tbody id="t1">

      </tbody>    
</table>
</body>  

----------------------------------------------------------------------------------------------------------------------------------------------

 

<Body οnlοad="...">  onload是在整个body页面加载完毕后,再加载onload里的方法

 

-----------------------------------------------------------------------------------------------------------------------------------------------

var resultArray = window.showModalDialog("add.jsp","","dialogWidth=300px;dialgHeight=400px;");

这个就可以弹出一个框架的效果:

 

在add.jsp中,操作完毕后,记得:

<script>
 function close() { 
  alert('信息添加成功!');
  window.close();
 }
</script>

 

--------------------------------------------------------------------------------------------------------------------------

οnblur="javascript:alert(1)" 是在鼠标离开文本框的时候

οnfοcus="javascript:alert(1)" 是在鼠标放入文本框的时候

--------------------------------------------------------------------------------------------------------------------------

 

 

知识如此,人生也一样吧~!

人生的道路上,时常回头看看,定能成长不少,少走弯路~!

 

 

 

 

 

 

  

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值