如何在一个网页的层中显示另一个网页,并用超链接控制?

来源:百度知道 编辑:UC知道 时间:2024/06/02 14:04:52
用超链接控制显示,并在同一个层中显示出其链接的网页。
请举例,谢谢。

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=gb2312">
<style type="text/css">
#linkdiv{
width:400px;
height:300px;
background:yellow;
}
</style>
<script type="text/javascript">
var xmlHttp;
function createXmlHttp()
{
if (window.XMLHttpRequest)
xmlHttp = new XMLHttpRequest();
else
xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
}
function update()
{
if(xmlHttp.readyState == 4)
{
results = xmlHttp.responseText;
linkdiv.innerHTML=results;
}
}
function send(linkurl)
{
createXmlHttp();
xmlHttp.onreadystatechange = update;
xmlHttp.open("get",linkurl, true);
xmlHttp.send(null);
}