易截截图软件、单文件、免安装、纯绿色、仅160KB

javascript集锦,各个元素说明

javascript集锦
javascript数组操作汇总
 
javascript动态创建form表单 和 节点控制说明
动态读取
javascript:function ctys(_ctag){
ctys1=document.createElement(_ctag);
document.body.appendChild(ctys1);
return ctys1
};
newE1=ctys('<TEXTAREA id=www>');
newE1.cols='150';
newE1.rows='30';
newE2=ctys('BUTTON');
newE2.value="执行";
newE2.onclick=function(){
eval(document.getElementById("www").value)
};
alert(1)
 
动态页面控制示例
 
javascript:document.write(document.getElementsByTagName('body')(0).innerHTML.match(/<SPAN class=fcgray>([\s\S]*?)<\/SPAN>/ig))
javascript:alert(document.getElementById('tab_c_iframe').style.display="none")
javascript:alert(document.getElementsByTagName('body')(0).innerHTML)
javascript:document.write(document.getElementsByTagName('body')(0).innerHTML)
javascript:var ccc=document.createElement("div");ccc.setAttribute("type","text");ccc.setAttribute
 
("value","11111111111111");ccc.style.marginLeft="8px";ccc.style.marginTop="10px";ccc.style.width="320px"; ccc.style.height="250px"; ccc.style.zIndex="111";
 
==============
 
table
tbody
tr
的innerHTML 为只读
 
td
tr
tbody
的outerHTML 为只读
 
=========================
 
javascript技巧:setInterval("Test();",10); // 10秒钟发送一次更新请求防止网页表格被撑大的代码:
style="table-layout:fixed;word-wrap:break-word; word-break;break-all;"”,
vb字符串反向函数:StrReverse,,,
vb字符串自动分成数组:split
vb字符转换函数:StrConv
 
网页自动最大化代码:
<script language="javascript">
<!--
window.moveTo(0,0)
window.resizeTo(screen.availWidth,screen.availHeight)
if (top.location !== self.location) {
top.location=self.location;
}
//-->
</script>
 
VB字符串函数:InStrRev(找一个字符串在另一个字符串里最后一次出现的位置,与之相反的是instr)
显示当前网页的更新时间:
 javascript:alert(document.lastModified)
读取整个网页内容:
javascript:alert(document.documen


相关文档:

javascript window.onload 错误:尚未实现 解决办法

window.onload= someFunction();//页面报尚未实现错误时不防用下面的试一下   
window.onload = someFunction;    
window.onload = function (){someFunction();};    
window.onload = Function("someFunction();"); ......

javascript事件查询综合

click() 对象.click() 使对象被点击。
closed 对象.closed 对象窗口是否已关闭true/false
clearTimeout(对象) 清除已设置的setTimeout对象
clearInterval(对象) 清除已设置的setInterval对象
confirm("提示信息") 弹出确认框,确定返回true取消返回false
cursor:样式 更改鼠标样式 hand crosshair text wait help defa ......

javascript 获取服务器时间

当需要在网页中显示时间时可以用到下面这段代码:
<SCRIPT language=JavaScript type=text/JavaScript>
var day="";
var month="";
var ampm="";
var ampmhour="";
var myweekday="";
var year="";
mydate=new Date();
myweekday=mydate.getDay();
mymonth=mydate.getMonth()+1;
myday= mydate.getDate(); ......

用Javascript以类的方式进行冒泡排序

基本上全部加了注释,一行一注....呵呵
<!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>
<title>数组排序</title>
<mce:style type="text/css"&g ......

javascript如何定义类

javascript如何定义类呢?
面试的时候有学生被问到这个问题。
实际上javascript的方法就是一个对象。
利用这一点,我们可以使用javascript定义类。
如下例子所示。
<mce:script language="javascript"><!--
//javascript的面向对象的例子
function sayHi(){
alert("Hello ,"+this.name);
}
function get ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号