我收集的javascript document命令

本文汇总了多种在IE浏览器地址栏中直接执行的JavaScript命令,包括查看和修改Cookie、显示网页源代码、调整页面缩放比例等实用技巧。

引用地址:http://bbs.syue.com/thread-36034-1-1.html

直接在ie地址栏输入命令,回车,执行js。
这样也可以用来改变和获取元素的值和属性,很实用的。

查看cookie
javascript:alert(document.cookie)

直接编辑cookie
javascript:document.cookie=window.prompt("Linx Edit cookie:",document.cookie);void(0);

打不开〖internet选项〗的时候
javascript:window.external.showBrowserUI("PrivacySettings",null)

显示网页源代码
javascript:s=document.documentElement.outerHTML;document.write('<body></body>');document.body.innerText=s;

网页放大1.5倍
javascript:void(s=document.body.style);void(z=s.getAttribute('zoom'));if(z){s.setAttribute('zoom',(parseInt(z)+50)+'%');}else s.setAttribute('zoom','150%')

网页缩小0.5倍
javascript:void(s=document.body.style);void(z=s.getAttribute('zoom'));if(z){s.setAttribute('zoom',(parseInt(z)-50)+'%');}else s.setAttribute('zoom','50%')

右键另存为
javascript:document.write('<a href="http://www.baidu.com/img/baidu_logo.gif">右键另存为</a>');

获取页面所有链接
javascript:var a="";for(i=0;i<document.links.length; i++ )a+=document.links(i).href+"<br/>";document.write(a);

获取链接进来的css文件
1(源码)
javascript:str='';c=document.styleSheets;for(i=0;i<c.length;i++){o=c[i];if (o.href=='')continue;str+='========== ';str+=o.href;str+='<br><xmp>/n';str+=o.cssText;str+='</xmp><br><br>/n';};document.write(str);
2(地址)
javascript:str='<HTML><HEAD><BASE HREF="';str+=document.URL;str+='"></HEAD><BODY><br>/n';c=document.styleSheets;for(i=0;i<c.length;i++){o=c[i];if (o.src=='')continue;str+='<a href="';str+=o.href;str+='">';str+=o.href;str+='</a><br>/n';};str+='</BODY></HTML>';document.write(str);

获取链接进来的js文件
javascript:str='<HTML><HEAD><BASE HREF="';str+=document.URL;str+='"></HEAD><BODY><br>/n';c=document.scripts;for(i=0;i<c.length;i++){o=c[i];if (o.src=='')continue;str+='<a href="';str+=o.src;str+='">';str+=o.src;str+='</a><br>/n';};str+='</BODY></HTML>';document.write(str);

获取Flash文件
javascript:str='<HTML><HEAD><BASE HREF="';str+=document.URL;str+='"></HEAD><BODY><br>/n';c=document.all;for(i=0;i<c.length;i++){o=c[i];if(o.tagName!="OBJECT")continue;sih=o.innerHTML;nd=document.createDocumentFragment();nd.appendChild(document.createElement('<bod></body>'));nd.firstChild.outerHTML=sih;no=document.createElement(nd.firstChild.outerHTML);document.body.appendChild(no);str+='<a href="';str+=no.src;str+='">';str+=no.src;str+='</a><br>/n';};str+='</BODY></HTML>';document.write(str);

背景音乐文件
javascript:str='<HTML><HEAD><BASE HREF="';str+=document.URL;str+='"></HEAD><BODY><br>/n';c=document.all;for(i=0;i<c.length;i++){o=c[i];if(o.tagName!="BGSOUND")continue;str+='<a href="';str+=o.src;str+='">';str+=o.src;str+='</a><br>/n';};str+='</BODY></HTML>';document.write(str);

获取图像文件
1(图像)
javascript:z=1;strUrl='';str='';function getImg(){if(strUrl!=''){str+=(z++);str+='. <IMG SRC="';str+=strUrl;str+='"><br><br>/n';};};c=document.images;for(i=0;i<c.length;i++){o=c[i];strUrl=o.src;getImg();};strUrl=document.body.background;getImg();c=document.all;for(i=0;i<c.length;i++){o=c[i];if(o.tagName=='TABLE'||o.tagName=='TD'){strUrl=o.background;getImg();};if(o.tagName=='AREA'){strUrl=o.href;getImg();};};document.write(str);
2(地址)
javascript:z=1;strUrl='';str='';function getImg(){if(strUrl!=''){str+=(z++);str+='. <a href="';str+=strUrl;str+='">';str+=strUrl;str+='</a><br>/n';};};c=document.images;for(i=0;i<c.length;i++){o=c[i];strUrl=o.src;getImg();};strUrl=document.body.background;getImg();c=document.all;for(i=0;i<c.length;i++){o=c[i];if(o.tagName=='TABLE'||o.tagName=='TD'){strUrl=o.background;getImg();};if(o.tagName=='AREA'){strUrl=o.href;getImg();};};document.write(str);

frame页面
第一层frame进行检查
javascript:str='<HTML><HEAD><BASE HREF="';str+=document.URL;str+='"></HEAD><BODY><br>/n';c=document.all;for(i=0;i<c.length;i++){o=c[i];if(o.tagName!='IFRAME'&&o.tagName!='FRAME')continue;str+=o.tagName;str+=' : <a href="';str+=o.src;str+='">';if(o.name=='')str+=o.src;else str+=o.name;str+='</a><br>/n';};str+='</BODY></HTML>';document.write(str);

显示全部嵌套frame
javascript:str='';function getFrame(c,i,j){for(i=0;i<c.length;i++){o=c[i];for(k=0;k<j;k++)str+='  ';str+='<a href="';str+=o.location;str+='">';if(o.name!='')str+=o.name;else str+=o.location;str+='</a><br>/n';no=o.document.frames;if(no.length>0)getFrame(no,0,j+1)};};getFrame(document.frames,0,0);document.write(str);

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值