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
相关文档:
click() 对象.click() 使对象被点击。
closed 对象.closed 对象窗口是否已关闭true/false
clearTimeout(对象) 清除已设置的setTimeout对象
clearInterval(对象) 清除已设置的setInterval对象
confirm("提示信息") 弹出确认框,确定返回true取消返回false
cursor:样式 更改鼠标样式 hand crosshair text wait help defa ......
当需要在网页中显示时间时可以用到下面这段代码:
<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 是一款强大的广泛运用于现代Web站点及应用的脚本语言。作为一个技艺精湛的 Web 开发者,掌握JavaScript可以增强用户的使用体验,提供交互及富客户端等功能。
尽管JavaScript 的语法非常简单,但对于写程序而言仍然是困难重重,就是因为它的运行环境:基于Web浏览器。
以下您可以看到收集的8个实用的 JavaScrip ......