随笔分类 -  JavaScript

摘要:// 不提示窗口关闭对话框parent.window.opener = null;parent.window.open("", "_self");parent.window.close();parent.window.location.href = "";window.close();地址:http://my.oschina.net/midnight/blog/14695 阅读全文
posted @ 2013-04-19 11:10 吉布鑫 阅读(141) 评论(0) 推荐(0)
摘要:出现原因:如下给一个对象添加事件,结果运行时这个事件是可以执行,不过会报脚本错误“尚未实现”document.getElementById("clearNumberListBtn").onclick=clearNumbers();解决方法如下:document.getElementById("clearNumberListBtn").onclick=function (){clearNumbers(); }; 阅读全文
posted @ 2013-02-25 11:17 吉布鑫 阅读(276) 评论(0) 推荐(0)
摘要:row.cells[5].innerHTML = "<span style='display:none'>none</span><script defer='defer'>alert('OK!');<\/script>";注:(1)script只会在第一遍加载的时候被执行,需要加上defer属性(只有IE可以)。(2)IE会忽略开头是脚步的问题,所以要加上一行空代码。(3)defer属性会让脚本在全部加载完成后执行,所以脚本中不能有document.write,不然会写掉整个页面 阅读全文
posted @ 2013-02-22 13:52 吉布鑫 阅读(1963) 评论(0) 推荐(0)
摘要:由于select没有readOnly属性,设置其只读如下//支付方式限制修改 var select = document.all.pay_type1; select.onclick= function (){ var index = this.selectedIndex; this.onchange = function(){ this.selectedIndex = index; }; };只是一种伪只读 阅读全文
posted @ 2012-09-24 14:44 吉布鑫 阅读(3396) 评论(0) 推荐(0)
摘要:前几天,在用友华表控件上做了一个追踪事件,记录如下1写一个excel表function winLoad(){DCellWeb1.SetRows(<%=item_count+4%>, 0);//设置列数DCellWeb1.SetCols(<%=dept_count*cell+7%>, 0);//设置行数//...} 2添加双击方法<script language="javascript" for="DCellWeb1" event="MouseDClick(col, row)">if( col< 阅读全文
posted @ 2012-08-10 17:00 吉布鑫 阅读(540) 评论(0) 推荐(0)
摘要:function doddkm(){ var ran = Math.random(); var loan_id = document.all.LOAN_ID.value; var arr = window.showModalDialog("..src"); if ( arr != null && arr.length > 0){ document.all.LOAN_ID.value = arr[0]; }}在子窗口操作,返回一个array,写出这样也可以function doddkm(){ var ran = Math.random(); ... 阅读全文
posted @ 2012-08-10 16:47 吉布鑫 阅读(142) 评论(0) 推荐(0)