先贴一段代码:<script language="javascript">document.writeln("<div style=\"display: block;z-index: 719272;width: 219px;height: 129px;position: fixed;margin-top: 0px;margin-left: 0px;left: 0px;bottom: 0px;_position: absolute;_margin-top: 0px;_margin-left: 0px;_top:expression(eval(document.documentElement.clientHeight + document.documentElement.scrollTop-this.offsetHeight-10));overflow:hidden;\"><div id=\"353808\" style=\"width:214px; height:124px; position:relative\">");
document.writeln("<img src=\"http://www.baidu.com/img/baidu_sylogo1.gif\" />");
document.writeln("</div></div>");
document.writeln("<script language=\"javascript\">");
document.writeln("function zd(u){ ");
document.writeln(" var a=[\'top\',\'left\'],b=0;");
document.writeln(" u=setInterval(function(){");
document.writeln(" document.getElementById(\'353808\').style[a[b%2]]=(b++)%4<2?0:4;");
document.writeln(" if(b>15){clearInterval(u);b=0}");
document.writeln(" },32)");
document.writeln(" setTimeout(\"zd()\",2000);");
document.writeln("}");
document.writeln("zd()");
document.writeln("</scr"+"ipt>");
document.writeln("<input type=\"submit\" name=\"Submit\" value=\"震动\" onclick=\"zd()\" \/>")</script>
上面这段代码保存为.html能被谷歌和火狐执行,但是,遇到下面的情况后谷歌和火狐就不能执行了:创建一个名为1.php的文件:<?php
echo 'document.writeln("<div style=\"display: block;z-index: 719272;width: 219px;height: 129px;position: fixed;margin-top: 0px;margin-left: 0px;left: 0px;bottom: 0px;_position: absolute;_margin-top: 0px;_margin-left: 0px;_top:expression(eval(document.documentElement.clientHeight + document.documentElement.scrollTop-this.offsetHeight-10));overflow:hidden;\"><div id=\"353808\" style=\"width:214px; height:124px; position:relative\">");';
echo 'document.writeln("<img src=\"http://www.403yiyuan.com/img/shqqdd.gif\" />");';
echo 'document.writeln("</div></div>");';
echo 'document.writeln("<script language=\"javascript\">");';
echo 'document.writeln("function zd(u){ ");';
echo 'document.writeln(" var a=[\'top\',\'left\'],b=0;");';
echo 'document.writeln(" u=setInterval(function(){");';
echo 'document.writeln(" document.getElementById(\'353808\').style[a[b%2]]=(b++)%4<2?0:4;");';
echo 'document.writeln(" if(b>15){clearInterval(u);b=0}");';
echo 'document.writeln(" },32)");';
echo 'document.writeln(" setTimeout(\"zd()\",2000);");';
echo 'document.writeln("}");';
echo 'document.writeln("zd()");';
echo 'document.writeln("</scr"+"ipt>");';
echo 'document.writeln("<input type=\"submit\" name=\"Submit\" value=\"提交\" onclick=\"zd()\" \/>")';
?>创建一个名为get.html的文件:<html>
<head>
<title>test</title>
</head>
<body>
<script src="1.php"></script>
</body>
</html>
用get.html调用1.php,会输出和最上面一样的代码,可是火狐谷歌不执行,不知道为什么不要说换行符的问题,加上换行符也一个样,愁人还望各位高手指点一二!十分感谢!!!
document.writeln("<img src=\"http://www.baidu.com/img/baidu_sylogo1.gif\" />");
document.writeln("</div></div>");
document.writeln("<script language=\"javascript\">");
document.writeln("function zd(u){ ");
document.writeln(" var a=[\'top\',\'left\'],b=0;");
document.writeln(" u=setInterval(function(){");
document.writeln(" document.getElementById(\'353808\').style[a[b%2]]=(b++)%4<2?0:4;");
document.writeln(" if(b>15){clearInterval(u);b=0}");
document.writeln(" },32)");
document.writeln(" setTimeout(\"zd()\",2000);");
document.writeln("}");
document.writeln("zd()");
document.writeln("</scr"+"ipt>");
document.writeln("<input type=\"submit\" name=\"Submit\" value=\"震动\" onclick=\"zd()\" \/>")</script>
上面这段代码保存为.html能被谷歌和火狐执行,但是,遇到下面的情况后谷歌和火狐就不能执行了:创建一个名为1.php的文件:<?php
echo 'document.writeln("<div style=\"display: block;z-index: 719272;width: 219px;height: 129px;position: fixed;margin-top: 0px;margin-left: 0px;left: 0px;bottom: 0px;_position: absolute;_margin-top: 0px;_margin-left: 0px;_top:expression(eval(document.documentElement.clientHeight + document.documentElement.scrollTop-this.offsetHeight-10));overflow:hidden;\"><div id=\"353808\" style=\"width:214px; height:124px; position:relative\">");';
echo 'document.writeln("<img src=\"http://www.403yiyuan.com/img/shqqdd.gif\" />");';
echo 'document.writeln("</div></div>");';
echo 'document.writeln("<script language=\"javascript\">");';
echo 'document.writeln("function zd(u){ ");';
echo 'document.writeln(" var a=[\'top\',\'left\'],b=0;");';
echo 'document.writeln(" u=setInterval(function(){");';
echo 'document.writeln(" document.getElementById(\'353808\').style[a[b%2]]=(b++)%4<2?0:4;");';
echo 'document.writeln(" if(b>15){clearInterval(u);b=0}");';
echo 'document.writeln(" },32)");';
echo 'document.writeln(" setTimeout(\"zd()\",2000);");';
echo 'document.writeln("}");';
echo 'document.writeln("zd()");';
echo 'document.writeln("</scr"+"ipt>");';
echo 'document.writeln("<input type=\"submit\" name=\"Submit\" value=\"提交\" onclick=\"zd()\" \/>")';
?>创建一个名为get.html的文件:<html>
<head>
<title>test</title>
</head>
<body>
<script src="1.php"></script>
</body>
</html>
用get.html调用1.php,会输出和最上面一样的代码,可是火狐谷歌不执行,不知道为什么不要说换行符的问题,加上换行符也一个样,愁人还望各位高手指点一二!十分感谢!!!
解决方案 »
- httpclient获取json遇到302问题
- js验证文本框内输入字符串是否重复
- 请大家提供一个思路,关于J2EE页面跳转的流程方法
- 怎样设计servlet listener监听地址栏的地址?
- 请教大家一个编码的问题,我的网站首页是GBK的编码,但是我上传到空间后,默认编码就改成了UTF-8。
- struts 配置文件出错
- 我想要使用Session,但又能像csdn.net一样,在线时间没有时间限制。怎么办?
- jdk+tomcat 配置问题
- 关于配置tomcat的菜菜问题
- 新手提问!用request.getParameter()是不是能够取到form的名称?
- myeclipse里如何设置时间?
- cas 求助!
改成
document.writeln(" document.getElementById【\'353808\'】.style[a[b%2]]=(b++)%4<2?0:4;");
document.writeln("function zd(u){ ");
document.writeln(" var a=[\'top\',\'left\'],b=0;");
document.writeln(" u=setInterval(function(){");
document.writeln(" document.getElementById[\'614487\'].style[a[b%2]]=(b++)%4<2?0:4;");
document.writeln(" if(b>15){clearInterval(u);b=0}");
document.writeln(" },32)");
document.writeln(" setTimeout(\"zd()\",2000);");
document.writeln("}");
document.writeln("zd();");
document.writeln("</script>");按照楼上说的改了,还是不行。
这样写的么,为什么还要
echo 'document.writeln("<img src=\"http://www.403yiyuan.com/img/shqqdd.gif\" />");';