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">
var chicun;
chicun=screen.width;
if(chicun==1280||chicun==1440||chicun==1600)
{
<!--
function initEcAd() {
document.all.AdLayer1.style.posTop = -100;
document.all.AdLayer1.style.visibility = 'vis ......
基本上全部加了注释,一行一注....呵呵
<!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 ......
1、字符串转换为数值
常规方法:
JScript code
var a = parseFloat("12");
var b = parseInt("34");
可以用
JScript code
var a = +("12");
var b = +("34");
2、多维数组
常规方法:
JScript code
var A = new Array(2);
A[0] = new Array(2);
A[1] = new Array(2);
A[0][0] = 1;
A[0][1] = 2;
A[1][0] = ......
最近要用到相关技术,先贴在这,有空再翻页。
本文转自:
http://www.codeguru.com/Cpp/I-N/ieprogram/article.php/c4399
http://www.codeguru.com/cpp/i-n/ieprogram/article.php/c4399/JavaScript-Calls-from-C.htm
http://www.codeproject.com/KB/COM/jscalls.aspx
Introduction
Sometimes, when we are usi ......