如何用JS在网页中替换HTML代码

evaporate 2006-04-29 02:38:14
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>上服旅行网</title>
<style type="text/css">
<!--
body {
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
}
-->
</style>
</head>
<script language="JavaScript" type="text/javascript">
var MM_contentVersion = 6;
var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ?
navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;
if ( plugin ) {
var words = navigator.plugins["Shockwave Flash"].description.split(" ");
for (var i = 0; i < words.length; ++i){
if (isNaN(parseInt(words[i])))
continue;
var MM_PluginVersion = words[i];
}
var MM_FlashCanPlay = MM_PluginVersion >= MM_contentVersion;
}
else if( navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0 &&
(navigator.appVersion.indexOf("Win") != -1) ) {
document.write('<SCR' + 'IPT LANGUAGE=VBScript\> \n');
document.write('on error resume next \n');
document.write('MM_FlashCanPlay = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & MM_contentVersion)))\n');
document.write('</SCR' + 'IPT\> \n');
}
if ( MM_FlashCanPlay ) {
alert('有播放器')
setInterval('document.getElementById("zg_ab").cols="2000,*"')
}else{
alert('无播放器')
setInterval('document.getElementById("zg_ab").cols="0,*"')
<frame src="help/help.html" name="b" frameborder="no" scrolling="auto" id="b" title="rightFrame" />'
//上句代码的作用就是想把HTML中的<frame src="blank.html" name="b" frameborder="no" scrolling="auto" id="b" title="rightFrame" />替换为<frame src="help/help.html" name="b" frameborder="no" scrolling="auto" id="b" title="rightFrame" />'先加载一个空网页blank.html如果判断无FLASH播放器在载入help.html页.
但不能实现,请问如何写!!!

}
</script>
<frameset cols="2000,*" frameborder="no" border="0" framespacing="0" id="zg_ab">
<frame src="in_a.html" name="a" frameborder="no" scrolling="no" noresize="NORESIZE" id="a" title="mainFrame" />
<frame src="blank.html" name="b" frameborder="no" scrolling="auto" id="b" title="rightFrame" />
</frameset>
<noframes>
<body>
</body>
</noframes>
</html>
...全文
450 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
jingxiaoping 2006-12-07
  • 打赏
  • 举报
回复
用div先把frame括起来,然后利用div.innerhtml=""的方法进行更换。
九型思维 2006-04-29
  • 打赏
  • 举报
回复
熟悉web2.0,blog,ajax,rss,.net2005等请进入
http://blog.csdn.net/datehr/category/198305.aspx
evaporate 2006-04-29
  • 打赏
  • 举报
回复
版面有点乱在重新发一次,也就是在JS中实现
<frame src="blank.html" name="b" frameborder="no" scrolling="auto" id="b" title="rightFrame" />
替换为
<frame src="help/help.html" name="b" frameborder="no" scrolling="auto" id="b" title="rightFrame" />
先加载一个空网页blank.html如果判断无FLASH播放器在载入help.html页.
但不能实现,请问如何写!!!继续等!!!!!
evaporate 2006-04-29
  • 打赏
  • 举报
回复
在线等~~~~请大家进来看看.

87,910

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧