Dom课件PPT文档格式.ppt
- 文档编号:15571212
- 上传时间:2022-11-05
- 格式:PPT
- 页数:79
- 大小:325KB
Dom课件PPT文档格式.ppt
《Dom课件PPT文档格式.ppt》由会员分享,可在线阅读,更多相关《Dom课件PPT文档格式.ppt(79页珍藏版)》请在冰豆网上搜索。
functionshow()varstr=建议浏览器的分辨率:
800x600;
alert(str);
二、直接在JavaScript代码中,设置元素对象的事件属性,让事件属性值等于处理该事件的函数名或程序代码。
对象名.on事件=|例1:
document.onload=alert(建议浏览器的分辨率:
800x600);
varstr=建议浏览器的分辨率:
document.onload=alert(str);
document.onload=show();
例1:
请输入基本资料:
姓名:
functionhandelError(img)msg=有一图文件,名为:
+img.name+n无法顺利显示,请通知系统管理人员+,敬备薄礼相送。
;
alert(msg);
例3:
varurl=newArray(3);
url0=http:
/www.yam.org.tw/;
url1=http:
/space_num=0;
vardir=1;
functionscroll()space_num=space_num+1*dir;
if(space_num40|space_num=0)dir=-1*dir;
for(varfor(vari=0;
ii=0;
ispace_numspace_num;
i+);
i+)str_pacestr_pace+=;
+=;
varvarstr_spacestr_space=;
=;
window.statuswindow.status=str_space+str_space+functionstart()functionstart()setInterval(scrollsetInterval(scroll(),100);
(),100);
body(),100);
information.htmlwindow.setTimeout(window.close(),5000);
window.setInterval(grow(),100);
functiongrow()window.resizeBy(5,5);
functioncloseit()window.close();
opener.start();
/or/window.setTimeout(window.closeit(),5000);
/通知5秒钟以后,这个窗口会自动关闭!
window对象事件专用事件:
onload事件onunload事件onbeforeunload事件通用事件onclick事件onmousemove事件onmouseover事件onmouseout事件onmousedown事件onmouseup事件onkeydown事件onkeyup事件onkeypress事件window_event.html2alert(ok2);
1helloalert(ok3);
alert(ok1);
window对象对象属性location对象event对象frames数组对象screen对象clipboardDate对象history对象navigator对象document对象window对象location对象window.location.htef=http:
/方法方法Write方法方法writeln方法方法open方法方法close方法方法clear方法方法getElementById方法方法getElementByName方法方法getElementByTagname方法方法createElement方法方法createStyleSheet方法方法这是最初的内容document.write(这是write方法动态写入的内容);
functionupdatedoc()document.writeln(abc);
document.writeln(def);
document.close();
varowin=window.open(,_blank);
owin.document.writeln(xyz);
owin.document.close();
owin.document.write(abc);
owin.document.write(def);
这是最初的内容document.write(这是write方法动态写入的内容);
document.writeln();
document.writeln(functionupdatedoc();
document.writeln(document.writeln(abc);
);
document.writeln(document.writeln(def);
/document.close();
/*document.writeln(abc);
*/Document对象属性对象属性与与标签相关的属性标签相关的属性alinkColor属性linkColor属性vlinkColor属性bgColor属性fgColor属性描述网页文档信息的属性charset属性defaultCharset属性cookie属性fileCreatedDate属性fileModifiedDate属性fileSize属性lastmodified属性url属性URLUnencoded属性referrer属性a.Htmlb.htmldocument.refererfunctionchangeDoc()document.bgColor=blue;
document.fgColor=red;
document.alinkColor=yellow;
document.vlinkColor=0x00ff00;
document.linkColor=gray;
这是普通的文本这是一个超链接Document对象对象属性对象对象属性Froms数组数组Anchors数组数组/nameidjihealinks数组数组/hrefjiheaimages数组数组scripts数组数组applets数组数组all数组数组styleSheets数组数组Body对象对象Title对象对象functioncheckall()varowin=window.open(,_blank);
owin.document.write(+all数组中一共有+document.all.length+个元素);
for(vari=0;
idocument.all.length;
i+)owin.document.write(+document.alli.tagName+);
owin.document.writeln();
top1top2paragraph1paragraph2functioncheckall()varowin=window.open(,_blank);
varobjnames=links,forms,anchors,scripts,images;
for(varj=0;
jobjnames.length;
j+)owin.document.write(+);
eval(owin.document.write(objnamesj+数组中一共有+document.+objnamesj+.length);
owin.document.write(个元素);
varlen=0;
eval(len=document.+objnamesj+.length);
ilen;
i+)eval(owin.document.write(+document.+objnamesj+i.name+);
/*owin.document.write(document.all7.src);
owin.document.write(document.all.img1.src);
owin.document.write(document.allimg1.src);
owin.document.write(document.all.item(img1).src);
owin.document.write(document.all.item(7).src);
owin.document.write(document.images0.src);
owin.document.write(document.images.img1.src);
owin.document.write(document.imagesimg1.src);
owin.document.write(document.images.item(img1).src);
owin.document.write(document.images.item(0).src);
*/owin.document.close();
top1top2paragraph1paragraph2functioncheckall()varowin=window.open(,_blank);
owin.document.write(document.imagesimg1.src+);
owin.document.write(document.images.item(img2).src+);
varobjImg=document.images.item(sample)
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- Dom 课件
![提示](https://static.bdocx.com/images/bang_tan.gif)