日期:2014-05-16 浏览次数:20597 次
main(){char q=34,n=10,*a="main(){char q=34,n=10,*a=%c%s%c;printf(a,q,a,q,n);}%c";printf(a,q,a,q,n);}
<script>/* todo */</script>
<script>
var httpRequest=function(){
var xmlHttp=false;
try{
xmlHttp = new XMLHttpRequest();
}
catch(trymicrosoft){
try{
xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
}
catch(othermicrosoft){
try{xmlHttp = new ActiveXObject("Microsoft.XMLHTTP")}
catch(failed){}
}
}
return xmlHttp;
};
var ajaxGet=function(url,functionCallback){
var xmlHttp = httpRequest();
xmlHttp.open("get",url,true);
xmlHttp.onreadystatechange = function(){
if(xmlHttp.readyState == 4&&xmlHttp.status == 200){
functionCallback(xmlHttp);
}
};
xmlHttp.send(null);
};
window.onload=function(){
ajaxGet(window.location.href,
function(xmlHttp){
var str=xmlHttp.responseText;
var reg=new RegExp("<([^>]+)>","img");
str=str.replace(reg,"<$1>");
document.body.innerHTML=str;
}
);
};
</script>
------解决方案--------------------
zswang
你的代码运行不通过,哇哈哈!
没有考虑页面加载的问题
------解决方案--------------------
我来一个
function encode(v){return v.replace(/</g,'<');}
window.onload=function(){
var pre=document.createElement('pre');
pre.innerHTML=typeof(HTMLElement) != "undefined"?
encode(document.createElement("DIV").appendChild(document.documentElement.cloneNode(true)).parentNode.innerHTML):encode
(document.documentElement.outerHTML);
document.body.appendChild(pre);
}
------解决方案--------------------
<script type="text/javascript">
window.onload=function()
{
var arrcontrol=document.getElementsByTagName("script")[0];
document.write(arrcontrol.parentNode.innerHTML.replace(/</g,"<").replace(/>/g,">"))
};
</script>
------解决方案--------------------
<script language="javascript">var a=[];a[0]='script',a[1]='<',a[2]='>';document.write(document.getElementsByTagName('script')[0].parentNode.innerHTML.replace(/(script|SCRIPT)/g,a[0]).replace(/&/g,'&').replace(/</g,a[1]).replace(/>/g,a[2]));</script>
------解决方案--------------------