[问题-unfinished],怎样使动态改变的js里的document.write任意时间都可以显示在页面上, 问题是不在appendChild前面加一个alert() , append上去的js中的document.write语句通通无效
2007-03-16 10:39
901 查看
<html>
<head>
<title> 问题,怎样使js里的document.write任意时间都可以显示在页面上, 问题是不在appendChild前面加一个alert() , append上去的js中的document.write语句通通无效 </title>
</head>
<body>
<script language="javascript" type="text/javascript">
function set()
{
var vlocation = document.location.href;
varr = vlocation.split( "?" );
params = varr[1];
if( typeof(params)!="undefined" )
{
var arr = params.split("=");
scripturl = arr[1];
if( typeof(scripturl) !="undefined")
{
vsrc = decodeURIComponent(scripturl);
os= document.createElement('script');
os.src = vsrc;
sleep_ttyp();
//alert(vsrc);
document.body.appendChild(os);
//document.body.appendChild(os);
}
}
}
function sleep(num) //JK
{
var tempDate=new Date();
var theXmlHttp = new ActiveXObject( "Microsoft.XMLHTTP" );
while((new Date()-tempDate)<num )
{
try{
theXmlHttp .open( "get", "about:blank?JK="+Math.random(), false );
theXmlHttp .send();
}
catch(e){;}
}
return;
}
function sleep_ttyp()
{
var xmlServerHttp = new ActiveXObject("Msxml2.ServerXMLHTTP.4.0");
//var xmlServerHttp = new ActiveXObject( "Microsoft.XMLHTTP" );
var lResolve = 5 * 1000;
var lConnect = 5 * 1000;
var lSend = 15 * 1000;
var lReceive = 15 * 1000;
xmlServerHttp.setTimeouts(lResolve, lConnect, lSend, lReceive);
xmlServerHttp.open("GET", "/plus/x.html", false);
xmlServerHttp.send();
}
set();
//document.getElementById('previewJs').src="http://t/plus/list.php?by=top&limit=10&height=20&color=undefined&bgColor=";
</script>
</body>
</html>
<html>
<head>
<title> 问题,怎样使js里的document.write任意时间都可以显示在页面上 </title>
</head>
<body>
<!-- test url http://t/plus/previewList.html?script=%2Fplus%2Flist.php%3Fby%3Dtop%26limit%3D10%26height%3D20%26color%3Dundefined%26bgColor%3D -->
<iframe name="preview" width=420 height=330 frameborder=0 scrolling=auto></iframe>
<script language="javascript" type="text/javascript">
function set()
{
var vlocation = document.location.href;
varr = vlocation.split( "?" );
params = varr[1];
if( typeof(params)!="undefined" )
{
var arr = params.split("=");
scripturl = arr[1];
if( typeof(scripturl) !="undefined")
{
vsrc = decodeURIComponent(scripturl);
var os= document.createElement('script');
os.src = vsrc;
alert(vsrc);
frm = document.frames['preview'];
frm.document.open();
frm.document.write( "<html>\n<body><div></div>\n</body>\n</html>" );
frm.document.close();
alert(frm.document.body.innerHTML);
frm.document.body.appendChild(os);
frm.document.open();
frm.document.close();
}
}
}
set();
//$('previewJs').src="http://t/plus/list.php?by=top&limit=10&height=20&color=undefined&bgColor=";
</script>
</body>
</html>
<head>
<title> 问题,怎样使js里的document.write任意时间都可以显示在页面上, 问题是不在appendChild前面加一个alert() , append上去的js中的document.write语句通通无效 </title>
</head>
<body>
<script language="javascript" type="text/javascript">
function set()
{
var vlocation = document.location.href;
varr = vlocation.split( "?" );
params = varr[1];
if( typeof(params)!="undefined" )
{
var arr = params.split("=");
scripturl = arr[1];
if( typeof(scripturl) !="undefined")
{
vsrc = decodeURIComponent(scripturl);
os= document.createElement('script');
os.src = vsrc;
sleep_ttyp();
//alert(vsrc);
document.body.appendChild(os);
//document.body.appendChild(os);
}
}
}
function sleep(num) //JK
{
var tempDate=new Date();
var theXmlHttp = new ActiveXObject( "Microsoft.XMLHTTP" );
while((new Date()-tempDate)<num )
{
try{
theXmlHttp .open( "get", "about:blank?JK="+Math.random(), false );
theXmlHttp .send();
}
catch(e){;}
}
return;
}
function sleep_ttyp()
{
var xmlServerHttp = new ActiveXObject("Msxml2.ServerXMLHTTP.4.0");
//var xmlServerHttp = new ActiveXObject( "Microsoft.XMLHTTP" );
var lResolve = 5 * 1000;
var lConnect = 5 * 1000;
var lSend = 15 * 1000;
var lReceive = 15 * 1000;
xmlServerHttp.setTimeouts(lResolve, lConnect, lSend, lReceive);
xmlServerHttp.open("GET", "/plus/x.html", false);
xmlServerHttp.send();
}
set();
//document.getElementById('previewJs').src="http://t/plus/list.php?by=top&limit=10&height=20&color=undefined&bgColor=";
</script>
</body>
</html>
<html>
<head>
<title> 问题,怎样使js里的document.write任意时间都可以显示在页面上 </title>
</head>
<body>
<!-- test url http://t/plus/previewList.html?script=%2Fplus%2Flist.php%3Fby%3Dtop%26limit%3D10%26height%3D20%26color%3Dundefined%26bgColor%3D -->
<iframe name="preview" width=420 height=330 frameborder=0 scrolling=auto></iframe>
<script language="javascript" type="text/javascript">
function set()
{
var vlocation = document.location.href;
varr = vlocation.split( "?" );
params = varr[1];
if( typeof(params)!="undefined" )
{
var arr = params.split("=");
scripturl = arr[1];
if( typeof(scripturl) !="undefined")
{
vsrc = decodeURIComponent(scripturl);
var os= document.createElement('script');
os.src = vsrc;
alert(vsrc);
frm = document.frames['preview'];
frm.document.open();
frm.document.write( "<html>\n<body><div></div>\n</body>\n</html>" );
frm.document.close();
alert(frm.document.body.innerHTML);
frm.document.body.appendChild(os);
frm.document.open();
frm.document.close();
}
}
}
set();
//$('previewJs').src="http://t/plus/list.php?by=top&limit=10&height=20&color=undefined&bgColor=";
</script>
</body>
</html>
相关文章推荐
- js实现 页面显示系统时间(中文显示星期)、动态倒计时页面跳转
- js实现动态获取系统时间,显示到页面上
- 快速解决js动态改变dom元素属性后页面及时渲染的问题
- js实现动态获取系统时间,显示到页面上
- JS实现HTML页面中动态显示当前时间完整示例
- 快速解决js动态改变dom元素属性后页面及时渲染的问题
- 在JSP页面中通过JS动态显示时间程序
- js模板,我们可以在<script>片断中定义一个被JS调用的代码,但代码又不在页面上显示.
- vue.js遇到的问题-数组数据改变,页面不能实时显示
- js动态改变img元素src在IE无效的问题
- ajax根据ID查询数据库并返回Json格式数据返回js,使用append显示到页面。判断json值为[]或者[[]]的问题。
- jsp页面利用js动态显示当前系统时间
- js 实现页面动态显示时间
- 动态调用包含document.write的js文件,动态调用外部js文件时,文件中alert起作用 document.write不起作用
- 通过“document.write”方式,在js文件引入js文件时,造成页面空白问题
- document.write插入js标签会覆盖页面的问题
- android 聊天列表页面的时间显示问题--1(星期显示,暂无分块)
- [Android疑难杂症]动态改变Background后Padding无效的问题
- JS动态显示当前系统时间
- js实现动态显示时间(setInterval())